当我在一页中多次调用一个程序时,我很难调用和显示内容。我试图显示两种不同的SP调用MISQL的两套单独记录。我可以显示第一个调用,但第二个调用失败。我不知道我做错了什么,但也许有人能帮上忙吗?
我不断得到错误 当我打电话 第二个程序:
Error calling SPCommands out of sync; you can t run this command now
我在窗边奔跑
下面的代码... PHP
// First call to SP
$page = 2;
$section = 1;
include("DatabaseConnection.php"); //general connection - works fine
$sql = CALL GetPageContent(" .$page. ", " .$section. ") ;
$result = mysqli_query($conn, $sql) or die( Error calling SP .mysqli_error($conn));
while($row=mysqli_fetch_assoc($result))
{
// DO STUFF< REMOVED TO MAKE READING CLEARER
}
mysqli_free_result($result);
//SECOND CALL BELOW
$section = 2; // change parameter for different results
$sql = CALL GetPageContent(" .$page. ", " .$section. ") ;
$result = mysqli_query($conn, $sql) or die( Error calling SP .mysqli_error($conn));
while($row=mysql_fetch_assoc($result))
{
// DO STUFF< REMOVED TO MAKE READING CLEARER
}