To start with:
Go to one of the on-line SQL tutorail sites and learn how to formulate a query.
Then make a simple query, and figure out how it works.
After that add fields from related tables, one table at a time,
so that you can see the effect of how joining tables works.

Also, watch how you name your fields. "Date" is a reserved word in MySQL, do not use it as a field name, you're only creating potential trouble. Check the MySQL docs for reserved words.

Your present query lacks a FROM clause which is one reason it won't work. Nor do you have any join conditions to link the tables.

Rather than trying to fix this, which is a bit of a hash, start with the basics, then work up to more complex queries.

Regards - Miles Thompson

At 10:53 AM 7/26/2003 +0300, Ahmed Abdelaliem wrote:
i am making a simple search form
how can i search more than one table for the same word
i used a query and it failed
here it is
@ $db = mysql_connect("localhost");

$test_tr = mysql_query("select,,,,
newdvd.type, newpcgames.type, olddvd.type, screener.type,,,,,
newdvd.cds, newpcgames.cds, olddvd.cds, screener.cds,
newdvd.downloader, newpcgames.downloader, olddvd.downloader, screener.downloader, where like '%".$word."%'
or like '%".$word."%' or like '%".$word."%' or like '%".$word."%'");

<rest snipped - let's concentrate on the query!>

-- PHP Database Mailing List ( To unsubscribe, visit:

Reply via email to