0

可能重复:
致命错误:调用非对象上的成员函数 fetch_assoc()

我有以下代码:

$this->open_connection();
$result = $this->connection->query($this->query);           
while($this->rows[] = $result->fetch_assoc()){}                     
$result->close();
$this->close_connection();
array_pop($this->rows);

在 localhost 上运行这段代码,没有给我任何问题,我返回了查询的值。但是从服务器运行时向我发送以下错误:

Fatal error: Call to a member function fetch_assoc() on a non-object in /home/code..on    line 36

我已经阅读了几篇出版物,但我还没有设法解决这个小问题。感谢您的贡献。

4

0 回答 0