I tried this:
Code: Select all
SELECT * FROM t1,t2,t3,t4 WHERE t1.id = '$id' OR t2.id = '$id' OR t3.id = '$id' OR t4.id = '$id' LIMIT 1I also tried:
Code: Select all
SELECT * FROM t1 WHERE id = '$id' UNION SELECT * FROM t2 WHERE id = '$id' UNION SELECT * FROM t3 WHERE id = '$id' UNION SELECT * FROM t4 WHERE id = '$id'I even tried:
Code: Select all
SELECT * FROM t1,t2 WHERE t1.id = '$id' OR t2.id = '$id'I'm not very fluent at MySQL, but mainly because I can't understand the Documentation. Anyone have any ideas? I know that I could do four separate queries, but I have no way of knowing which table the id will be in, and then I'll have to make sure that I select all the data from the correct table because each table has a differect structure, other than the id column.