ID: 28860
Updated by: [EMAIL PROTECTED]
Reported By: adamsbarker at hotmail dot com
Status: Bogus
Bug Type: MySQL related
Operating System: Windows XP
PHP Version: 5CVS-2004-06-21 (dev)
New Comment:
If the server responds with "unkown command", you should
upgrade your server to 4.1 (.3-beta).
Previous Comments:
------------------------------------------------------------------------
[2004-07-18 01:49:01] adamsbarker at hotmail dot com
I have checked "mysqli_error" and it comes up with "Unknown command".
The thing I don't get is that each statement on its own works perfectly
in "mysqli_multi_query", however, if trying to add any more than 1
statement, it does nothing.
------------------------------------------------------------------------
[2004-07-17 16:12:46] [EMAIL PROTECTED]
if mysqli_multi_query fails, you should check your error
with mysqli_error instead of filing a bug report.
------------------------------------------------------------------------
[2004-06-21 00:44:24] adamsbarker at hotmail dot com
Description:
------------
"mysqli_multi_query" works fine when only using 1 statement, however
when using more than 1 statement the function returns empty.
Reproduce code:
---------------
$query = "SELECT * FROM database_name.first_table;";
$query .= "SELECT * FROM database_name.second_table";
/* execute multi query */
if (mysqli_multi_query($link, $query)) {
do {
/* store first result set */
if ($result = mysqli_store_result($link)) {
while ($row = mysqli_fetch_row($result)) {
printf("%s\n", $row[0]);
}
mysqli_free_result($result);
}
/* print divider */
if (mysqli_more_results($link)) {
printf("-----------------\n");
}
} while (mysqli_next_result($link));
}
Expected result:
----------------
Works perfect when this line is taken out:
$query .= "SELECT * FROM database_name.second_table";
But doesn't work when this line is kept in.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28860&edit=1