SYP}{ER
07-27-2002, 12:00 PM
Ok, I have the following tables:
Quotes, Avatars, Jokes, and Facts.
Each table has these fields for sure:
member, category, source, body, rating, times_rated, and table_id
Now this query doesn't work:
$sql = "SELECT member, category, source, body, rating, times_rated, table_id FROM quotes, avatars, jokes, facts WHERE member LIKE '%$member%' AND category LIKE '%$category%' AND source LIKE '%$source%' AND body LIKE '%$body%'";
The error:
Column: 'member' in field list is ambiguous.
How can I pull these fields from each table without having an incredibly long SQL query with a bunch of quotes.FIELDNAME and WHERE quotes.FIELDNAME LIKE ... AND avatars.FIELDNAME like...
Is this possible, or will I need to query the DB 4 times, once for each table?
Thanks a million for any help :)
Quotes, Avatars, Jokes, and Facts.
Each table has these fields for sure:
member, category, source, body, rating, times_rated, and table_id
Now this query doesn't work:
$sql = "SELECT member, category, source, body, rating, times_rated, table_id FROM quotes, avatars, jokes, facts WHERE member LIKE '%$member%' AND category LIKE '%$category%' AND source LIKE '%$source%' AND body LIKE '%$body%'";
The error:
Column: 'member' in field list is ambiguous.
How can I pull these fields from each table without having an incredibly long SQL query with a bunch of quotes.FIELDNAME and WHERE quotes.FIELDNAME LIKE ... AND avatars.FIELDNAME like...
Is this possible, or will I need to query the DB 4 times, once for each table?
Thanks a million for any help :)