note 123448 added to mysqli.multi-query
| From: | filippo at ecoms dot it | Date: | Mon, 17 Dec 2018 20:57:29 +0000 |
| Subject: | note 123448 added to mysqli.multi-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-209917@lists.php.net to get a copy of this message | ||
Tested with PHP 5.6.29
<?php
/*
$mysqli = mysqli object
$query = string with the multi query
*/
$results = array();
if (!$mysqli->multi_query($query))
throw new Exception();
while (true) {
$result = $mysqli->store_result();
if ($mysqli->errno != 0)
throw new Exception();
$results[] = $result === false ? true : $result;
/*
$mysqli->affected_rows and insert_id here are relative to the current result
*/
if ($mysqli->more_results()) {
if (!$mysqli->next_result())
throw new Exception();
}
else
break;
}
/*
$results = array of the results, each element can be true or a mysqli_result object
*/
?>
----
Server IP: 208.43.231.9
Probable Submitter: 95.255.136.168
----
Manual Page -- http://php.net/manual/en/mysqli.multi-query.php
Edit -- https://master.php.net/note/edit/123448
Del: integrated -- https://master.php.net/note/delete/123448/integrated
Del: useless -- https://master.php.net/note/delete/123448/useless
Del: bad code -- https://master.php.net/note/delete/123448/bad+code
Del: spam -- https://master.php.net/note/delete/123448/spam
Del: non-english -- https://master.php.net/note/delete/123448/non-english
Del: in docs -- https://master.php.net/note/delete/123448/in+docs
Del: other reasons-- https://master.php.net/note/delete/123448
Reject -- https://master.php.net/note/reject/123448
Search -- https://master.php.net/manage/user-notes.php