我有一个查询

$qdrop=mysqli_query($connect,"select TABLE_NAME,create_time
      FROM INFORMATION_SCHEMA.TABLES
      WHERE table_schema = 'purbalingga'
      AND CREATE_TIME <='2016-10-07' and TABLE_NAME LIKE '2016%'");


一会儿展示数组

while ($datadrop=mysqli_fetch_array($qdrop)) {
      echo $qdrop['TABLE_NAME'];echo"<br/>";
       }


但是我有一个错误:

Fatal error: Cannot use object of type mysqli_result as array in E:\xampp\htdocs

最佳答案

更换:

while ($datadrop=mysqli_fetch_array($qdrop)) {
  echo $qdrop['TABLE_NAME'];
  echo"<br/>";
}


带有:

while ($datadrop=mysqli_fetch_array($qdrop)) {
  echo $datadrop['TABLE_NAME'];
  echo"<br/>";
}


$qdrop仅保存查询,而$datadrop是保存result in array的查询。

关于php - 如何在php中的显示表模式查询中显示数组,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39908160/

10-11 02:51