if(mysql_num_rows(mysql_query("SHOW TABLES LIKE '".$table."'")==1) {echo "Table exists";} else {echo "Table does not exist";}