<?
    
function table_exists($table_name)
    {
        
$tables mysql_query("SHOW TABLES");
        while (
$table mysql_fetch_row($tables))
        {
            if (
$table_name == $table[0])
            {
                return 
true;
            }
        }    
        return 
false;
    }
?>