我正在开发一个PHP应用程序并连续调用两个存储过程。 当我尝试这样做时会出现以下错误
Command out of sync; you can't run this command now
我检查了一些解决方案并添加了store_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