execute MySQL stored procedures

Since a stored procedure doesn't know ahead of time how many results will be returned, the client needs to support reading any multiple of results. Therefore, if the server sees that you don't have CLIENT_MULTI_RESULTS set, it will give an error saying that it can't return a result set in the given context. To fix this the following change must be made.

The code needs to be changed from:
$connection = @mysql_connect($url['host'], $url['user'], $url['pass'], TRUE, 2);
to:
$connection = @mysql_connect($url['host'], $url['user'], $url['pass'], TRUE, 131074);

This changes the flag at the end from CLIENT_FOUND_ROWS to (CLIENT_FOUND_ROWS | CLIENT_MULTI_RESULTS).



你可能感兴趣的:(execute MySQL stored procedures)