note 42330 added to function.mysql-list-tables
| From: | zeubeubeu at free dot fr | Date: | Wed, 12 May 2004 10:38:19 +0000 |
| Subject: | note 42330 added to function.mysql-list-tables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69519@lists.php.net to get a copy of this message | ||
Just another way to verify the existence of a table based on the function below :
function mysql_table_exists($base, $table, $link)
{
$exists = mysql_query('SHOW TABLES FROM
'.$base.' LIKE
\''.$table.'\'', $link);
return mysql_num_rows($exists) == 1;
}
You can extend this function for multi-checks by changing the pattern of the LIKE if you store
separate tables for archive like LIKE 'mails_200%' for example.
----
Manual Page -- http://www.php.net/manual/en/function.mysql-list-tables.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42330
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42330&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42330&report=yes
Search -- http://master.php.net/manage/user-notes.php