note 114544 added to mysqli.multi-query

From: Date: Wed, 05 Mar 2014 10:29:29 +0000
Subject: note 114544 added to mysqli.multi-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-198795@lists.php.net to get a copy of this message
Following code can be used to resolve mysqli::next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method $query = "SELECT SOME_COLUMN FROM SOME_TABLE_NAME;"; $query .= "SELECT SOME_OTHER_COLUMN FROM SOME_TABLE_NAME"; /* execute multi query */ if (mysqli_multi_query($this->conn, $query)) { $i = true; do { /* store first result set */ if ($result = mysqli_store_result($this->conn)) { while ($row = mysqli_fetch_row($result)) { printf("%s\n", $row[0]); } mysqli_free_result($result); } /* print divider */ if (mysqli_more_results($this->conn)) { $i = true; printf("-----------------\n"); } else { $i = false; } } while ($i && mysqli_next_result($this->conn)); } ---- Server IP: 103.21.58.218 Probable Submitter: 49.248.35.154 ---- Manual Page -- http://php.net/manual/en/mysqli.multi-query.php Edit -- https://master.php.net/note/edit/114544 Del: integrated -- https://master.php.net/note/delete/114544/integrated Del: useless -- https://master.php.net/note/delete/114544/useless Del: bad code -- https://master.php.net/note/delete/114544/bad+code Del: spam -- https://master.php.net/note/delete/114544/spam Del: non-english -- https://master.php.net/note/delete/114544/non-english Del: in docs -- https://master.php.net/note/delete/114544/in+docs Del: other reasons-- https://master.php.net/note/delete/114544 Reject -- https://master.php.net/note/reject/114544 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#198795) next »