#32433 [NEW]: problem with multi_query
| From: | alexzhen at hotmail dot com | Date: | Wed, 23 Mar 2005 18:23:25 +0000 |
| Subject: | #32433 [NEW]: problem with multi_query | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-75766@lists.php.net to get a copy of this message | ||
From: alexzhen at hotmail dot com
Operating system: WinXP (Professional) with SP2
PHP version: 5.0.3
PHP Bug Type: MySQLi related
Bug description: problem with multi_query
Description:
------------
using php5.0.3 and mysql 4.1.9
i think i've similar bug with <a
href="http://bugs.php.net/bug.php?id=31668">http://bugs.php.net/bug.php?id=31668</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");
$mysqli->query("");
$mysqli->close();
thanks
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
--
Edit bug report at http://bugs.php.net/?id=32433&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32433&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32433&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32433&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32433&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32433&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32433&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32433&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32433&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32433&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32433&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32433&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32433&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32433&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32433&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32433&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32433&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32433&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32433&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32433&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32433&r=mysqlcfg