php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49370 Missing constants MYSQL_CLIENT_MULTI_RESULTS
Submitted: 2009-08-26 11:05 UTC Modified: 2009-08-28 09:45 UTC
From: dg at artegic dot de Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.2.10 OS: *
Private report: No CVE-ID: None
 [2009-08-26 11:05 UTC] dg at artegic dot de
Description:
------------
When dealing with MySQL STORED PROCEDURES it's often necessary to set 
flags as a parameter for mysql_connect which are not (yet?) defined in 
the current versions:

CLIENT_MULTI_STATEMENT (65536) and
CLIENT_MULTI_RESULTS (131072)

Otherwise the application will return a "PROCEDURE xxx can't return a 
result set in the given context" error, even if a CALL from phpMyAdmin 
or any other client is working without problems.


Reproduce code:
---------------
  mysql_connect ($host, $user, $pw, $newlink);
  mysql_unbuffered_query ('CALL myproc()');

won't work, but

  mysql_connect ($host, $user, $pw, $newlink, 131072)
  mysql_unbuffered_query ('CALL myproc()');

will work just as expected.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-28 09:45 UTC] andrey@php.net
But ext/mysql doesn't have means of using multiple result sets, and a SP call will produce at least 1 result set (the status result set) and probably more, if you perform selects in it. For this purpose you need to use ext/mysqli.
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 01 03:04:47 2023 UTC