Page 1 of 1

searching multiple tables

Posted: Mon Dec 05, 2005 4:42 pm
by elecktricity
is it possible to search multiple tables when using php to search the database? any links or code would be greatly appreciated

Posted: Mon Dec 05, 2005 5:05 pm
by hawleyjr

Code: Select all

$someID = 1;

SELECT table1.*,table2.* from table1 
where
table1.id = $someID and table2.id = $someID
Also, you may want to search here for JOINS.

Posted: Mon Dec 05, 2005 5:05 pm
by Chris Corbyn
What database system (DBMS) are you using? MySQL, PostgreSQL, Microsoft SQL? It's possible to "join" your tables in a single query yes. Could you give some more info? :)

Posted: Mon Dec 05, 2005 6:30 pm
by elecktricity
using mysql, ill go lookup the 'JOINS' thing