php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #45099 PROCEDURE xxx can't return a result set in the given context(same as in mysqli)
Submitted: 2008-05-26 22:27 UTC Modified: 2008-11-05 16:38 UTC
Votes:9
Avg. Score:4.8 ± 0.6
Reproduced:5 of 5 (100.0%)
Same Version:3 (60.0%)
Same OS:4 (80.0%)
From: carsten at brandt-henke dot de Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.2.6 OS: *
Private report: No CVE-ID: None
 [2008-05-26 22:27 UTC] carsten at brandt-henke dot de
Description:
------------
same problem as described here for mysqli ( http://bugs.php.net/bug.php?id=42548 ) seems to exist in the mysql extension. I get the same error message when trying to call a PROCEDURE in MySQL.

The Error-Message:

1312 - PROCEDURE databsename.select_user_login can't return a result set in the given context )

Reproduce code:
---------------
procedure has been added by sql-query:

DELIMITER |

CREATE PROCEDURE `select_user_login` 
(
  IN  `v_email`     varchar(128),
  IN  `v_password`  varchar(32)
)
BEGIN
     SELECT  user_id, username  FROM  user  WHERE  user.`email` = v_email;
END|

DELIMITER ;

-------
php-code:

$res = mysql_query("CALL select_user_login('$email', '$pw')");

Expected result:
----------------
well, no error ;-)

Actual result:
--------------
MySQL-Error 

1312 - PROCEDURE databsename.select_user_login can't return a result set in the given context )

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-26 23:52 UTC] jani@php.net
From bug #40085: "mysql extension doesn't support advanced features like prepared statements and stored procedures. For using these features you have to use mysqli extension."

That's pretty clear. This really should be documented -> reclassified.
 [2008-11-05 16:38 UTC] vrana@php.net
Already documented "Although this MySQL extension is compatible with MySQL 4.1.0 and greater, it doesn't support the extra functionality that these versions provide." at http://cz2.php.net/manual/en/mysql.installation.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 18 06:01:30 2024 UTC