我已经为一个表编写了一个存储过程,之后我在 php 函数中对同一个表执行查询,但是我得到了错误:
Error in db : Commands out of sync, you can't run the command now..
我也尝试了 mysqli:multi_query 而不是 mysqli:query,但我得到了空输出。 谁能帮我解决这个问题。
P.S:存储过程按预期工作,查询也正确..但一起返回错误。
最佳答案
您必须使用所有选择,然后导航到下一个结果
$sql="";
if (mysqli_multi_query($link, $sql)) {
do {
if ($result = mysqli_store_result($link)) {
while ($row = mysqli_fetch_array($result)) {
array_push($arrows,$row);
}
mysqli_free_result($result);
}
} while (mysqli_next_result($link));
}
关于php - 在 mysql/PHP 中执行存储过程时出现错误 "Commands out of sync, you can' t 立即运行命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7691010/