On 19-Sep-2003 Dan Anderson wrote:
> I am trying to make my PHP script autodetect when a table in a mySQL
> database exists, and when it doesn't, create it.  
> 
<snip>

function tableexists($tbl) {
    $res = @mysql_query("SELECT 1 FROM $tbl");
    return ($res ? true : false);
}


Regards,
-- 
Don Read                                     [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
                            (53kr33t w0rdz: sql table query)


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to