MySQL Hell
Having a problem with MySQL;
I have 2 tables and using the following to join them
SELECT * FROM table1,table2 WHERE table1.id=table2.id AND table1.id=$requiredid;
where $requiredid is a vairiable generated by PHP to look up a row.
Table2 has supplimentary info, BUT the existance of table2's info is not required, therefore the condition table1.id=table2.id may be false. BUT I would still like to return the info from table1 (where table1.id=$requiredid).
Can someon please tell me how to join these 2 tables and return all table1's info and table2's if it is available.
|