Bug #66624 [Opn->Nab]: Bug? Don't return the results of all sentences SQL
| From: | johannes@php.net | Date: | Sun, 16 Feb 2014 02:14:53 +0000 |
| Subject: | Bug #66624 [Opn->Nab]: Bug? Don't return the results of all sentences SQL | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-184315@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66624&edit=1
ID: 66624
Updated by: johannes@php.net
Reported by: bspbsp15 at gmail dot com
Summary: Bug? Don't return the results of all sentences SQL
-Status: Open
+Status: Not a bug
Type: Bug
Package: MySQLi related
Operating System: Windows 7 SP1 x32
PHP Version: 5.5.8
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
MySQL can't safely continue parsing after an error. PHP doesn't care.
Previous Comments:
------------------------------------------------------------------------
[2014-02-01 21:29:52] bspbsp15 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/mysqli.multi-query
---
If you put in multi_query() 3 SQL sentences for example: Valid1; Non-valid2; Valid3; only you get
results of the first SQl sentence.
¿Is a bug or its my conceptual error?
Test script:
---------------
$query = 'Valid SQL sentence;';
$query .= 'NON valid SQL sentence;'; //For example: Incorrect table.
$query .= 'Valid SQL sentence;';
$mysqli->multi_query($query);
$mysqli->next_result(); //Returns TRUE, ok (valid SQL sentence)
$result = $mysqli->store_result();
$row = $result->fetch_assoc();
var_dump($row[0]);
$mysqli->next_result(); //Returns FALSE, Ok (non valid SQL sentence)
$mysqli->next_result(); //Returns FALSE, but is a valid SQL sentence
$result = $mysqli->store_result();
$row = $result->fetch_assoc();
var_dump($row[0]);
Expected result:
----------------
In the second evaluation $mysqli->next_result() returns FALSE because is a non-valid SQL sentece
is OK, but if you try to get the results of the next valid SQL sentence you can't, if you try
to evaluate again retuns FALSE again.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66624&edit=1