note 112634 added to mysqli.store-result
| From: | TexMorgan | Date: | Sat, 06 Jul 2013 22:45:16 +0000 |
| Subject: | note 112634 added to mysqli.store-result | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195479@lists.php.net to get a copy of this message | ||
There's a simpler way to clear out database stored procedure problems:
class MySQLiQuery {
protected $_resultSet;
protected $databaseConnection;
....
protected function free(){
$this->_resultSet->free();
$this->_resultSet=null;
}
protected function checkMoreResults(){
if($this->databaseConnection->more_results()){
return true;
} else {
return false;
}
}
protected function clearResults(){
if($this->checkMoreResults()){
if($this->databaseConnection->next_result()){
if($this->_resultSet=$this->databaseConnection->store_result()){
$this->free();
}
$this->clearResults(); // <----------- recursive call is your friend
}
}
}
.......
}
----
Server IP: 64.71.164.2
Probable Submitter: 204.57.118.174
----
Manual Page -- http://php.net/manual/en/mysqli.store-result.php
Edit -- https://master.php.net/note/edit/112634
Del: integrated -- https://master.php.net/note/delete/112634/integrated
Del: useless -- https://master.php.net/note/delete/112634/useless
Del: bad code -- https://master.php.net/note/delete/112634/bad+code
Del: spam -- https://master.php.net/note/delete/112634/spam
Del: non-english -- https://master.php.net/note/delete/112634/non-english
Del: in docs -- https://master.php.net/note/delete/112634/in+docs
Del: other reasons-- https://master.php.net/note/delete/112634
Reject -- https://master.php.net/note/reject/112634
Search -- https://master.php.net/manage/user-notes.php