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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dg at artegic dot de
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC