duangang2825 2014-05-02 10:10
浏览 41
已采纳

mysqli_stmt :: get_result()调用undefined [duplicate]

This question already has an answer here:

I am changing all my scripts to prepared statements with mysqli and I have a problem. I get this error when I use get_result() and I don't know why. My php version is 5.3.

Here is the code I use:

$user=$_GET['user'];
$stmt = $dbc->prepare("select * from `users` where id= ? and stare!=1"); 
$stmt->bind_param('s', $user);
$stmt->execute();
$result = $stmt->get_result();
if ($row = $result->fetch_assoc()) {

//do something

}

Error:

Call to undefined method mysqli_stmt::get_result() in /home/websoft/public_html/twingoo/engine/app/profil_edit.php on line 13
</div>
  • 写回答

1条回答 默认 最新

  • dragon5006 2014-05-02 10:17
    关注

    I encountered this problem recently.

    You need to make sure that the mysqlnd extension is installed for that particular part of mysqli to work.

    Depending on if you are using Windows or Linux (and what flavor of either) will determine how this is done.

    In CentOS, it is pretty straight-forward :

    yum install php-mysqlnd
    

    And to confirm it is installed, you can create a php page with the following :

    <?php
    phpinfo();
    ?>
    

    Then look for mysqlnd or native

    You can also validate it is installed by

    php -m | grep mysqlnd
    

    OR

    php -i | grep mysqlnd
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化