[snip]
+-------------+------------+-------------+
 | artist     | area       | magic       |
+-------------+------------+-------------+
 | Joe Bloggs | AZ*IN*TX   | childrens   |
+-------------+------------+-------------+
 | Fred Smith | All        | close-up    |
+-------------+------------+-------------+

SELECT * FROM artist WHERE (area LIKE '%$area%' OR area = 'All') AND magic
LIKE '%$magic%'

(where $area and $magic are variables passed from PHP).
[/snip]

It's not your query, it's you database structure. For area, you would need
to a.) have a column for each area (say, up to five) or, 2.)have named
regions so that someone looking for a magician could select their region and
then the type of magician. LIKE '%anything%' is too general, especially
twice.

HTH!

Jay



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to