Hello again,

in order to use Stored Procedures in MySQL through PHP you usually either use pdo or mysqli connections.
However if do not wish to redo your application connections and you don’t require any out parameters you can use “mysql_connect($host, $user, $password, true, 65536);” on connection, using the 65536 ( CLIENT_MULTI_STATEMENTS ) internal magic constant. But you can make only one stored procedure call per connection, and there is no support for OUT parameters. It is not currently documented, but can be found in the php header file.

If you do not use this connection method, you’ll get a “#1312 – PROCEDURE database.procedure can’t return a result set in the given context” error whenever you CALL a procedure that returns a result set.

[del.icio.us] [Digg] [Facebook] [Twitter]

One Response

  1. voj Says:

    Thanks! I was able to make it work with PEAR DB.
    In PEAR DB,you can modify connection string mysql.php under DB package and add that constant 65536. :)

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.