|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2004-09-14 10:19 UTC] nxcoder at gmail dot com
 Description:
------------
use 
$str ="select @@autocommit;";
$str .= "select current_user();";
reportting errors!
-------------------------
use
$str ="select @@autocommit;";
or
$str = "select current_user();";
result is right;
Reproduce code:
---------------
<?php
echo "<pre>";
$mysqli = new mysqli("localhost", "root", "", "EPS");
if(mysqli_connect_errno())
    die(mysqli_connect_error());
$str ="select @@autocommit;";
$str .= "select current_user();";
$mysqli->multi_query($str) or die($mysqli->error);
do{
    if($result=$mysqli->store_result())
        while($row = $result->fetch_array())
            print_r($row);
} while($mysqli->next_result());
?>
Expected result:
----------------
print out two array
Actual result:
--------------
Unknown command
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 13:00:01 2025 UTC | 
tested against latest cvs and 5.0.2. Output: Array ( [0] => 1 [@@autocommit] => 1 ) Array ( [0] => root@localhost [current_user()] => root@localhost ) Also your actual result is wrong/incomplete: please specify the complete error message next time.