php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66624 Bug? Don't return the results of all sentences SQL
Submitted: 2014-02-01 21:29 UTC Modified: 2014-02-16 02:14 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: bspbsp15 at gmail dot com Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.5.8 OS: Windows 7 SP1 x32
Private report: No CVE-ID: None
 [2014-02-01 21:29 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-02-16 02:14 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 [2014-02-16 02:14 UTC] johannes@php.net
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.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Jul 06 17:05:44 2022 UTC