执行SP时出现PHP MySql查询错误

执行SP时出现PHP MySql查询错误,php,mysql,stored-procedures,phpmyadmin,Php,Mysql,Stored Procedures,Phpmyadmin,我有一个触发MySQL SP的PHP脚本。直接对db运行时,SP cmd可以工作(我使用的是PhpMyAdmin UI)。测试时,PHP返回错误“Warning:mysql_num_rows()预期参数1为resource”,因为SP没有返回任何内容。调试脚本时,我看到变量$result1的所有参数都设置为null 脚本中有另一个SP使用与此相同的代码成功执行,因此我有点困惑。你知道问题是什么吗 $result1 = $mysqli->query("CALL sp_playerInvite

我有一个触发MySQL SP的PHP脚本。直接对db运行时,SP cmd可以工作(我使用的是PhpMyAdmin UI)。测试时,PHP返回错误“Warning:mysql_num_rows()预期参数1为resource”,因为SP没有返回任何内容。调试脚本时,我看到变量$result1的所有参数都设置为null

脚本中有另一个SP使用与此相同的代码成功执行,因此我有点困惑。你知道问题是什么吗

$result1 = $mysqli->query("CALL sp_playerInvite_pin_select('samsmith@hotmail.com')");
if(!$result1) die("CALL failed: (" . $mysqli->errno . ") " . $mysqli->error);
//echo json_encode($getPlayerInvitePin);

// check for empty result, if not then there is >1 pin corresponding to email
if (mysql_num_rows($result1) > 0) 
{
    //looping through all results-in theory should only 1 result
    while ($row = mysql_fetch_array($result1)) 
    {
        $response["pin"] = $row["player_pin"];
    }
// echoing JSON response
    echo json_encode($response);
}

SP…

不应该是mysqli\u num\u行吗?谢谢“我可以吃奶酪汉堡”:

你应该显示你的
sp
的代码,是不是应该是
mysqli\u num\u rows
?如果未正确关闭,则您的
。您显示的错误通常发生在查询(SQL)不正常时。SP已添加。SP在DB上运行。它不是SP AFAIKS