编写了一个脚本来打印数据库中存在的所有表的内容......但不幸的是我在某个地方出错了。谁能告诉我错误在哪里?
$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;
}
for ($i=1; $i<=5; $i++)
{
while ($row = mysql_fetch_row($result))
{
echo "Table: {$row[0]}\n";
$sql_1 = "SELECT * FROM {$row[0]}";
$result_1 = mysql_query($sql_1);
$row_1 = mysql_fetch_row($result);
echo "$row_1";
}
}
mysql_free_result($result);
?>
谢谢..