sigh
So you want to run a query that just does not happen at all if the table does not exist.
and how is the rest of your PHP script supposed to know that the query did not take place?
Just run the query, and check for errors.
this will do
if (!$result = mysql_query('select....'))
{
// error occured
echo mysql_error().mysql_errno();
}
else
{
// query ok, process results
}
find out which errorcode belongs to 'table does not exist' and your done.