note 22420 added to function.mysql-list-tables

From: Date: Mon, 17 Jun 2002 21:48:38 +0000
Subject: note 22420 added to function.mysql-list-tables
Groups: php.notes 
Request: Send a blank email to php-notes+get-31952@lists.php.net to get a copy of this message
Even though php guy's solution is probably the fastest here's another one just for the heck of it... I use this function to check whether a table exists. If not it's created. mysql_connect("server","usr","pwd") or die("Couldn't connect!"); mysql_select_db("mydb"); $tbl_exists = mysql_query("DESCRIBE sometable"); if (!$tbl_exists) { mysql_query("CREATE TABLE sometable (id int(4) not null primary key, somevalue varchar(50) not null)"); } -- http://www.php.net/manual/en/function.mysql-list-tables.php http://master.php.net/manage/user-notes.php?action=edit+22420 http://master.php.net/manage/user-notes.php?action=delete+22420 http://master.php.net/manage/user-notes.php?action=reject+22420

« previous php.notes (#31952) next »