我正在使用drupal。*此代码适用于测试数据库,但是当我将代码移动到实时站点时,它没有显示任何内容。*我可以通过命令提示符在实时数据库上使用“SHOW TABLES”命令,但不能通过drupal。会发生什么?
$result = db_query("SHOW TABLES"); // get all the tables
while ($obj = db_fetch_object($result))
{
$content .= "<br /><strong>" . $obj->Tables_in_test . "</strong>";
$result_desc = db_query("DESC $obj->Tables_in_test"); //get the columns in each table
while ($obj_desc = db_fetch_object($result_desc))
{
$content .= "<br />". $obj_desc->Field . " " . ("PRI" == $obj_desc->Key ? "(PK)" : $obj_desc->Key);
}
$content .= "<br />";
}
return $content;