Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP-调用未定义的方法mysqli_result::store_result()时出错_Php_Stored Procedures_Mysqli - Fatal编程技术网

PHP-调用未定义的方法mysqli_result::store_result()时出错

PHP-调用未定义的方法mysqli_result::store_result()时出错,php,stored-procedures,mysqli,Php,Stored Procedures,Mysqli,我正在开发一个PHP应用程序,并连续调用两个存储过程。 当我尝试这样做时,给出以下错误 Command out of sync; you can't run this command now 我检查了一些解决方案并添加了store\u result()函数,但目前正在标记另一个错误 Call to undefined method mysqli_result::store_result() 这里是我的应用程序的示例代码 $sql = "CA

我正在开发一个PHP应用程序,并连续调用两个存储过程。 当我尝试这样做时,给出以下错误

     Command out of sync; you can't run this command now
我检查了一些解决方案并添加了
store\u result()
函数,但目前正在标记另一个错误

     Call to undefined method mysqli_result::store_result()
这里是我的应用程序的示例代码

        $sql         = "CALL get_count_posttype('POST')";
        $result      = $conn->query($sql);
        $postCount   = $result->data_seek(0);

        #i tried to use the following as some post suggested
        #i am getting the following error
        #Call to undefined method mysqli_result::store_result()
        //$result->store_result(); 
        //$result->free_result();

        $sql         = "CALL get_postview_for_admin($offset,$recLimit,'POST')";

        $result      = $conn->query($sql);

        # SQL error : Commands out of sync; you can't run this command now

        #current PHP Version 5.5.9

您是否安装了MYSQLND驱动程序?这个方法需要它。@Barmar:我遵循了This post
$mysqlnd=function\u exists('mysqli\u fetch\u all');如果($mysqlnd){echo'mysqlnd enabled!';}
它显示为enabled。我知道这篇文章是很久以前写的,但它似乎使用
store\u result()
query()
不起作用。您需要准备并执行该语句。