|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-11-01 10:52 UTC] georg@php.net
[2004-11-01 11:09 UTC] georg@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 17:00:01 2025 UTC |
Description: ------------ I am using MySQL 5.0.1 (snapshot) and PHP 5.0.2 with mysqli interface (latest snapshot) under Linux (SUSE 9.1). I use $mysqli->multi_query to call a SP. I want to get back the SELECT results of the SP. With a normal connect ($mysqli = new mysqli($mysqlhost, $mysqluser, $mysqlpasswd, $mysqldb)), I don't get results. However, if I instead use $mysqli = mysqli_init + $mysqli->real_connect() with the very same parameters, everything works fine (many thanks to Gleb Paharenko for this tip). Reproduce code: --------------- This is my SP: CREATE PROCEDURE `test`() BEGIN SELECT * FROM t1; END And this it the PHP code $ok = $mysqli->multi_query("CALL test()"); if($ok) { echo "<p>OK</p>\n"; do { echo "<p>result</p>\n"; $result = $mysqli->store_result(); if($result) { show_table($result); // shows result details $result->close(); } } while($mysqli->next_result()); } Expected result: ---------------- With $mysqli->real_connect, the code above works fine. Actual result: -------------- With a normal connect ($mysqli = new mysqli(...)), $ok is always false.