嗨,我想列出数据库中的所有表并按时间排序,到目前为止,我该怎么做才能列出数据库中的所有表,但无法按时间排序;
$dbname = "album";
if (!mysql_connect("localhost", "root", "")) {
echo "Could not connect to mysql";
exit;
}
$sql = "SHOW TABLES FROM $dbname";
$result = mysql_query($sql);
if (!$result) {
echo "DB Error, could not list tables\n";
echo "MySQL Error: " . mysql_error();
exit;
}
$sorts = array();
while ($row = mysql_fetch_row($result)) {
echo "Table: {$row[0]}"."<br>";
}
mysql_free_result($result);