Copy code The code is as follows:
function list_tables($database)
{
$rs = mysql_list_tables($database);
$tables = array();
while ($row = mysql_fetch_row($rs) ) {
$tables[] = $row[0];
}
mysql_free_result($rs);
return $tables;
}
Copy the code The code is as follows:
Deprecated: Function mysql_list_tables() is deprecated in … on line xxx
Copy codeThe code is as follows:
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
Copy code code As follows:
function list_tables($database)
{
$rs = mysql_query("SHOW TABLES FROM $database");
$tables = array();
while ($row = mysql_fetch_row($rs)) {
$tables[] = $row[0];
}
mysql_free_result($rs);
return $tables;
}
The above introduces the implementation code of MySQL data table damage using PHP to obtain all tables in the MySQL database, including the content of MySQL data table damage. I hope it will be helpful to friends who are interested in PHP tutorials.