get_result() Doesn't Work even mysqlnd is enabled

醉酒当歌 提交于 2019-12-12 09:48:00

问题


It might be a duplication of many questions however i dont seem to get my answer from any of the questions present.I am using multi domain linux hosting provided by hostgator.I tried to use mysqli_stmt_get_result() but it throws me an error stating as anundefined method.I contacted the hostgator admin panel and they enabled the mysqlnd extension for me.I do see the mysqlnd extension enabled in phpinfo of my website.However i still see the same error.

$mysqlnd = function_exists('mysqli_stmt_get_result');

if ($mysqlnd) {
    echo 'mysqlnd enabled!';
}
else
   var_dump("nope");

I tried to check if it is enabled or not , it says nope but i do see mysqlnd as enabled in my phpinfo.

What is the problem and how can i solve this one ? Plus using with any other method is not an option because i have already coded the whole project using mysqli_stmt_get_result().

Update:

Query:

 $stmt=$this->link->prepare("SELECT `Session_Data`,`ip_address` FROM Session WHERE `Session_Id` = ? AND `Session_Expires` > '".date('Y-m-d H:i:s')."'");

        $stmt->bind_param("s",$id);
        $stmt->execute();
         $res=$stmt->get_result();

回答1:


I am answering my own question here as for all the people who are stuck in this thing.To make this thing work, Enable nd_mysqli in php extensions and disable mysqli.This will work like charm! Good Luck.




回答2:


Go to Cpanel ->PHP version under software section and change the options as below enable nd_mysqli




回答3:


Yes It worked with nd_mysqli option selected. Thanks @BOTJr. It also shows 'nd_mysqli skipped as conflicting' as an warning so no need to worry just disable mysqlnd, mysqli and then enable again nd_mysqli option. It will work fine.



来源:https://stackoverflow.com/questions/36723127/get-result-doesnt-work-even-mysqlnd-is-enabled

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!