October 20, 2025
Another Linux lie: we have a web scripting language
Truth is: you don't.
Enter the oh, so wonderful, multi-engine PDO which is supposed to be a glorious replacement for dated and worn mysqli. Not so fast!
Building on its 'by idiots, for idiots' reputation, PHP collective FUBARed PDO by having not tested it with stored procedures. Idiots who use PHP are quite content with their inline queries. Select a record here, insert a record there, done. For real work, we need to call stored procs, and here lies a snag: it does not work.
Try to CALL sp_something, and you will be savagely slapped on the face by this error:
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 2014 Cannot execute queries while there are pending result sets. Consider unsetting the previous PDOStatement or calling PDOStatement::closeCursor()
You can then call closeCursor() to your heart's content, on the previous query() calls. You can unset() your query or statement objects. All of that will be exercise in futility because the stored procedure call will keep throwing.
Genius is as genius does: always as a degenerate. They never tested stored procedures. Had they ever tested, they would have realized what kind of shit they released. But they had not. They never do. Instead they hire PR spin doctors to bully the affected and frustrated users into silence, and thus our global ID degrades back into stone age.
If you are facing this problem, all you have to do is to add closeQuery() after your fetch(), and the error will go away, and everything will work.
pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true) makes no difference whatsoever. True or false, PDO will still throw if you do not close your cursors. How inline SQL is able to fetch its results is beyond me. Ask the genius degenerates at PHP collective why.
Posted by: LinuxLies at
09:15 AM
| No Comments
| Add Comment
Post contains 310 words, total size 2 kb.
35 queries taking 0.0613 seconds, 148 records returned.
Powered by Minx 1.1.6c-pink.








