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() — Prepara o próximo resultado de multi_query
Descrição
Prepara o próximo conjunto de resultado de uma chamada anterior para mysqli_multi_query() que pode ser recuperado por mysqli_store_result() ou mysqli_use_result().
Parâmetros
- link
-
Apenas para estilo de procedimento: Um identificador de conexão retornado por mysqli_connect() or mysqli_init()
Valor Retornado
Retorna TRUE em caso de sucesso ou FALSE em falhas.
Exemplos
Veja mysqli_multi_query().
mysqli_next_result
pawel dot barcik at gmail dot com
21-Jun-2008 05:26
21-Jun-2008 05:26
