3 tables, 1 can be empty
Posted: Fri Feb 25, 2005 4:49 am
I want a query which will draw from 2 tables and the 3rd if the WHERE clause matches it.
At the moment i have this:
$table can be 1 of 2 tables, so ignore that. The 3rd table would be "notes" and does not always have a matching entry. If i use a join like i have above it will not show any results in the case that "notes" has no matching entry.
Any ideas?
At the moment i have this:
Code: Select all
$show = "SELECT * FROM $table,users WHERE $table.username=users.username AND orderno='$_GETїnumber]'";
$showq = mysql_query($show, $db_conn) or die("query show failed".mysql_error());Any ideas?