【发布时间】:2014-08-15 10:48:36
【问题描述】:
get_result() 函数有问题。
我的localhost 上的 php 脚本运行良好,但在服务器上出现此错误
Fatal error: Call to undefined method mysqli_stmt::get_result()
我搜索了很多次,但没有找到解决方案。我的代码:
$sql=$db->prepare("SELECT * FROM `news` WHERE cat = ? order by id desc limit 10");
$cat=$_GET['cat'];
$sql->bind_param('i', $cat);
$sql->execute();
$result=$sql->get_result();
if($result){
while ($row = $result->fetch_array()) { echo "something"; }
(“mysqli”和“mysqlnd”都安装了。)
我现在要做什么?
【问题讨论】:
-
用mysql的phpinfo驱动检查。
-
这可能有助于link
-
Fatal error: Call to undefined method mysqli_stmt::get_result() 的可能重复项 mysqli_stmt :: get_result 仅适用于 mysqlnd。
-
从 php.ini 我得到了这个信息 PDO 驱动 sqlite, mysql
-
phpinfo()下有mysqlnd部分吗?