PHP : Function Reference : MySQL Improved Extension : mysqli_store_result
lau
Beware when using stored procedures:
If you connect to the database and then call dbproc A followed by a call to db proc B and then close the connection to the db, the second procedure call will not work.
It looks like there is a bug in MYSQL or mysqli that returns an extra recordset than you would expect. It then doesn't let you call another stored procedure until you finish processing all the recordsets from the first stored procedure call.
The solution is to simply loop through the additional recordsets between calls to db procs. Here is a function that I call between db proc calls:
<?php
#--------------------------------
function ClearRecordsets($p_Result){
#--------------------------------
$p_Result->free();
while($this->Mysqli->next_result()){
if($l_result = $this->Mysqli->store_result()){
$l_result->free();
}
}
}
?>
|