Stored procedure causes “Commands out of sync” on the next query

前端 未结 5 1570
不知归路
不知归路 2020-12-16 04:58

I am running a query with a mysql stored procedure :

$AddProf_qr = mysql_query(\"call AddStudent(\'$d_Pass\', \'$d_Titl\', \'$d_Firs\', \'$d_Midd\',  \'$d_La         


        
5条回答
  •  一个人的身影
    2020-12-16 05:48

    Result sets returned from a stored procedure cannot be fetched correctly using mysqli_query(). The mysqli_query() function combines statement execution and fetching the first result set into a buffered result set, if any. However, there are additional stored procedure result sets hidden from the user which cause mysqli_query() to fail returning the user expected result sets.

    Result sets returned from a stored procedure are fetched using mysqli_real_query() or mysqli_multi_query(). Both functions allow fetching any number of result sets returned by a statement, such as CALL.

    look at official manual

提交回复
热议问题