this function returns FALSE when you have an error in your syntax in one of your queries, so be carefull with this type of construction when tracking errors:
<?php
//error in the second sub query
$result = $db->multi_query("select * from news; seleeeeeeect id from news; update news set title='new title' where id= 12 ");
//code inside object class
$this->_db = new Mysqli($host, $user, $password, $database, $port, $socket);
do {
$result = $this->_db->store_result();
$this->_resultMulti[] = $result;
$this->_errnoMulti[] = $this->_db->errno;
if(is_object($result)) {
$result->free_result();
}
} while($this->_db->next_result());
?>
in this construction all you have in the $this->_errnoMulti is :
array(1) {
[0]=>
int(0)
}
which means that there are no errors if you are not checking how many queries are executed!
mysqli::next_result
mysqli_next_result
(PHP 5)
mysqli_next_result — Prepare next result from multi_query
Description
bool mysqli::next_result
( void
)
Prepares next result set from a previous call to mysqli_multi_query() which can be retrieved by mysqli_store_result() or mysqli_use_result().
Parameters
- link
-
Procedural style only: A link identifier returned by mysqli_connect() or mysqli_init()
Return Values
Returns TRUE on success or FALSE on failure.
Examples
See mysqli_multi_query().
mysqli::next_result
pawel dot barcik at gmail dot com
22-Jun-2008 03:26
22-Jun-2008 03:26
