This code works even more simply.
$database = Database table is in.
$tablename = Table being searched for.
The above variables have to be pre-defined, and it helps if all tablenames are in lower case. Some Unix boxes have problems with case.
$tablelist = mysql_list_tables($database);
$result=mysql_fetch_array($tablelist);
if (in_array($tablename,$result)) {
// table exitst
} else {
// table doesnt exist
}