php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30081 multi_query error
Submitted: 2004-09-14 10:19 UTC Modified: 2005-11-22 18:05 UTC
From: nxcoder at gmail dot com Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.0.1 OS: win2000
Private report: No CVE-ID: None
 [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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-29 12:06 UTC] georg@php.net
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. 
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun May 16 08:01:24 2021 UTC