note 65813 added to function.mysqli-query
| From: | info at ff dot net | Date: | Mon, 08 May 2006 11:12:54 +0000 |
| Subject: | note 65813 added to function.mysqli-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-110849@lists.php.net to get a copy of this message | ||
Calling Stored Procedures
Beeners' note/example will not work. Use mysqli_multi_query() to call a Stored Procedure.
SP's have a second result-set which contains the status: 'OK' or 'ERR'.
Using mysqli_query will not work, as there are multiple results.
<?php
$sQuery="CALL SomeSP('params')";
if(!mysqli_multi_query($sqlLink,$sQuery)) {
// your error handler
}
$sqlResult=mysqli_store_result($sqlLink);
if(mysqli_more_results($this->sqlLink))//Catch 'OK'/'ERR'
while(mysqli_next_result($this->sqlLink));
?>
You will have to rewrite/expand this a bit for more usability of course, but it's just an
example.
----
Server IP: 194.109.193.119
Probable Submitter: 86.85.230.21
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.mysqli-query.php
Edit -- http://master.php.net/note/edit/65813
Del: integrated -- http://master.php.net/note/delete/65813/integrated
Del: useless -- http://master.php.net/note/delete/65813/useless
Del: bad code -- http://master.php.net/note/delete/65813/bad+code
Del: spam -- http://master.php.net/note/delete/65813/spam
Del: non-english -- http://master.php.net/note/delete/65813/non-english
Del: in docs -- http://master.php.net/note/delete/65813/in+docs
Del: other reasons-- http://master.php.net/note/delete/65813
Reject -- http://master.php.net/note/reject/65813
Search -- http://master.php.net/manage/user-notes.php