note 74478 added to function.mysqli-store-result

From: Date: Fri, 13 Apr 2007 08:29:02 +0000
Subject: note 74478 added to function.mysqli-store-result
Groups: php.notes 
Request: Send a blank email to php-notes+get-125353@lists.php.net to get a copy of this message
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(); } } } ?> ---- Server IP: 203.220.0.234 Probable Submitter: 220.236.199.186 ---- Manual Page -- http://www.php.net/manual/en/function.mysqli-store-result.php Edit -- https://master.php.net/note/edit/74478 Del: integrated -- https://master.php.net/note/delete/74478/integrated Del: useless -- https://master.php.net/note/delete/74478/useless Del: bad code -- https://master.php.net/note/delete/74478/bad+code Del: spam -- https://master.php.net/note/delete/74478/spam Del: non-english -- https://master.php.net/note/delete/74478/non-english Del: in docs -- https://master.php.net/note/delete/74478/in+docs Del: other reasons-- https://master.php.net/note/delete/74478 Reject -- https://master.php.net/note/reject/74478 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#125353) next »