ID: 41158 Updated by: [EMAIL PROTECTED] Reported By: zizka at seznam dot cz -Status: Assigned +Status: Wont fix Bug Type: Feature/Change Request Operating System: All PHP Version: 5.2.1 Assigned To: georg New Comment:
http://www.php.net/manual/en/ref.mysql.php: Although this MySQL extension is compatible with MySQL 4.1.0 and greater, it doesn't support the extra functionality that these versions provide. For that, use the MySQLi extension. Stored Procedures were introduced into MySQL 5.0, so you should use mysqli extension instead of mysql. Previous Comments: ------------------------------------------------------------------------ [2007-04-24 07:25:54] zizka at seznam dot cz I also suggest to note in the documentation that when MySQL extension is used to retrieve multiple results with CLIENT_MULTI_RESULTS flag set, MySQL returns an error "Commands out of sync". ------------------------------------------------------------------------ [2007-04-23 18:49:40] zizka at seznam dot cz For instance, in case of use of Stored Procedure which uses PREPARED statement which surely can not return a result (not SELECT or SHOW), but MySQL does not know it and marks the Stored Procedure as returning a record set, and then throws an exception "can t return a result set in the given context". With the flag MYSQL_CLIENT_MULTI_RESULTS, PHP is able to handle a "CALL ..." query without harming anything (tested). I've seen some other cases when people on the forums use this flag to allow PHP's MySQL extension use Stored Procedures which for some similar reason marked as returning a result set but they do not. This would be needed to document, that the constant is just for such purposes and the extension is not able to handle multiple results. That would also bring the information about such MySQL's behavior right into the PHP manual, what could, in my oppinion, help some programmers finding their 'bug' causing "can t return a result set in the given context". ------------------------------------------------------------------------ [2007-04-23 09:08:26] [EMAIL PROTECTED] >Sometimes a situation arises that this constant is needed even >though multiple results support is not needed. For instance? ------------------------------------------------------------------------ [2007-04-22 02:28:31] zizka at seznam dot cz Description: ------------ Please add MYSQL_CLIENT_MULTI_RESULTS to MySQL extension. Sometimes a situation arises that this constant is needed even though multiple results support is not needed. Currently everyone has to add define('MYSQL_CLIENT_MULTI_RESULTS', 131072); to his code. Reproduce code: --------------- <?php $conn = mysql_connect("localhost", "root", "", 1, MYSQL_CLIENT_MULTI_RESULTS); ?> Expected result: ---------------- ... Actual result: -------------- ... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41158&edit=1
