|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32433 problem with multi_query
Submitted: 2005-03-23 19:23 UTC Modified: 2005-03-23 23:47 UTC
From: alexzhen at hotmail dot com Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.0.3 OS: WinXP (Professional) with SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
23 - 20 = ?
Subscribe to this entry?

 [2005-03-23 19:23 UTC] alexzhen at hotmail dot com
using php5.0.3 and mysql 4.1.9

i think i've similar bug with <a href=""></a>

anyway, if you remove line 8 and 9. it work perfectly fine.
or you can add these following codes between the line 8 and 9.

$mysqli=new mysqli("localhost", "root", "xxx", "xxx");


Reproduce code:
1:		$mysqli = new mysqli("localhost", "root", "xxxxxxxxxxxxxx", "xxxxxxxxx");
2:		if ($mysqli->multi_query("select 1 as Total")) {		
3:			if (!$result = $mysqli->store_result()) die("first section query error");
4:			echo "Total: ".$result->fetch_object()->Total; //should output Total: 1.
5:			echo "<br><br>";
6:			$result->free();
7:		}else echo $mysqli->error;
8:		$mysqli->close();
9:		$mysqli = new mysqli("localhost", "root", "xxxxxxxxxxxxx", "xxxxxxxxxxxxx");
10:	if ($mysqli->multi_query("select 1 as Total;select 2 as Needle")) {
11:		if (!$result = $mysqli->store_result()) die("second section query error");
12:		echo "Total: ".$result->fetch_object()->Total;
13:		$result->free();
14:		echo "<br><br>";
15:		$mysqli->next_result();
16:		if (!$result = $mysqli->store_result()) die("second section query error");
17:		echo "Needle: ".$result->fetch_object()->Needle;
18:		$result->free();
19:	}else echo $mysqli->error;	
20:	$mysqli->close();

Expected result:
Total: 1

Total: 1

Needle: 2

Actual result:
Total: 1

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';select 2 as Needle' at line 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-23 23:47 UTC]
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 19:01:28 2024 UTC