note 105560 deleted from function.mysql-list-tables by tularis
| From: | tularis@php.net | Date: | Sun, 28 Aug 2011 18:07:53 +0000 |
| Subject: | note 105560 deleted from function.mysql-list-tables by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182777@lists.php.net to get a copy of this message | ||
Note Submitter: wasifk007 at gmail dot com
Reason: in docs
----
It can also be done with function mysql_query().
See the code below
function mysql_table_exists($dbLink, $database, $tableName)
{
$tables = array();
$tablesResult = mysql_query("SHOW TABLES FROM $database;", $dbLink);
while ($row = mysql_fetch_row($tablesResult)) $tables[] = $row[0];
if (!$result) {
}
return(in_array($tableName, $tables));
}
http://www.show-ip.org