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