PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

mysqli::options> <mysqli_multi_query
Last updated: Fri, 14 Nov 2008

view this page in

mysqli_next_result

mysqli->next_result()

(PHP 5)

mysqli_next_result -- mysqli->next_result()Prepara o próximo resultado de multi_query

Descrição

bool mysqli_next_result ( mysqli $link )

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().



add a note add a note User Contributed Notes
mysqli_next_result
pawel dot barcik at gmail dot com
21-Jun-2008 05:26
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::options> <mysqli_multi_query
Last updated: Fri, 14 Nov 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites