I need to use something like the: mysql_query(SELECT * FROM test1 WHERE user='test'); However, the user field is in another table. How do I do this? PHP:
What does your db structure looks like? Do you have any foreign key relationship between these two tables?
it's hard to say without knowing what your tables contain but you basically need to join the table and do something like select test1.* from test1,test2 where test1.bla=test2.bla and test2.user='test' where test2 is your other table and bla is the field that you use to link the 2 tables. hope this helps,
Yeah. Actually, just check out "JOINS", as their are many types. In this particular situation, I personally would use a LEFT JOIN, but an INNER JOIN would work just as well.