note 83979 added to mysqli.next-result

From: Date: Sun, 22 Jun 2008 00:26:22 +0000
Subject: note 83979 added to mysqli.next-result
Groups: php.notes 
Request: Send a blank email to php-notes+get-140645@lists.php.net to get a copy of this message
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! ---- Server IP: 92.48.74.199 Probable Submitter: 84.9.196.212 ---- Manual Page -- http://www.php.net/manual/en/mysqli.next-result.php Edit -- https://master.php.net/note/edit/83979 Del: integrated -- https://master.php.net/note/delete/83979/integrated Del: useless -- https://master.php.net/note/delete/83979/useless Del: bad code -- https://master.php.net/note/delete/83979/bad+code Del: spam -- https://master.php.net/note/delete/83979/spam Del: non-english -- https://master.php.net/note/delete/83979/non-english Del: in docs -- https://master.php.net/note/delete/83979/in+docs Del: other reasons-- https://master.php.net/note/delete/83979 Reject -- https://master.php.net/note/reject/83979 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140645) next »