I get the following error when calling a 2nd stored procedure using PHP PDO:
SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
Normally this error occurs when you haven't used fetchAll() to get all the data back from MySQL before requesting more data. However in this case I am using fetchAll on all stored procedure calls.
Two workarounds are possible. Either use $stmt->closeCursor() after each stored procedure call or replace the stored procedures with SELECT queries instead.
Is there something about stored procedures that leaves data 'unfetched'?
fetchAll()from one result set without usingnextRowset()for example? - Michael Berkowski