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 -- mysqli_next_result — Prépare le prochain résultat d'une requête multiple
Description
bool mysqli::next_result
( void
)
Prépare le prochain jeu de résultat, initialisé par un appel antérieur à mysqli_multi_query(), et qui peut être lu par mysqli_store_result() ou mysqli_use_result().
Liste de paramètres
- link
-
Style procédural uniquement : Un identifiant de lien retourné par la fonction mysqli_connect() ou par la fonction mysqli_init()
Valeurs de retour
Cette fonction retourne TRUE en cas de succès, FALSE en cas d'échec.
Exemples
Voir mysqli_multi_query().
mysqli::next_result
pawel dot barcik at gmail dot com
21-Jun-2008 05:26
21-Jun-2008 05:26
