RE: [PHP] Finding out if a table exists

2003-01-21 Thread Don Read
On 21-Jan-2003 Mako Shark wrote: > Is there a way of finding if a table exists with only > one command in MySQL? I've looked through the MySQL > functions, and the closest I've gotten to what I need > is mysql_list_tables or mysql_tablename (I'll have to > check into these a little more), but I wa

Re: [PHP] Finding out if a table exists

2003-01-21 Thread 1LT John W. Holmes
L PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, January 21, 2003 1:05 PM Subject: Re: [PHP] Finding out if a table exists > Okay what the hell I'm bored anyway... > > function mysql_table_exists($table) > { > global $db; // <- database resource handle >

Re: [PHP] Finding out if a table exists

2003-01-21 Thread Kevin Stone
Okay what the hell I'm bored anyway... function mysql_table_exists($table) { global $db; // <- database resource handle $result = @mysql_list_tables($db); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_row($result)) { if (strtolower($row[0