11

2nd rant this week on PHP PDO

PHP 💩:
PHP message: 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

Me 🤬:
THATS WHAT I’M FUCKING USING. STOP FUCKING COMPLAINING. YOU DIDN’T LIKE THE FUCKING COLONS FOR YOUR FUCKING PARAMATETRS, NOW YOU HATE YOUR OWN FUCKING FETCHALL() METHOD YOU PEICE OF SHIT, AND YOU CAN’T HAVE ANY OTHER ACTIVE QUERIES AS IT’S THE FIRST FUCKING QUERY. ARRGHHH!!!!!

What the actual fuck is wrong with PDO. It bitches about everything 😡.

Comments
  • 1
    Got the same shit the other day.
    Solved it by passing the parameters in call as an associative array instead of setting em in the request object before the call.
  • 1
    I don't miss this at all

    Other interfaces/ORMs in other languages just work.
  • 1
    I got it to work by unsettling the query variable it was bitching about. I’VE NEVER NEEDED TO DO THAT, WHAT THE FUCK PDO, NOW YOU FUCKING COMPLAIN ABOUT THAT!!!

    Also, now that I have it working, I have asked MySQL to give me 1 row, selected by a single ID, It’s returned every row, WHAT THE ACTUAL FUCK!!!!!!
  • 0
    @err-occured 😂

    Best of luck!
  • 0
  • 0
    @err-occured
    You're still using fetchAll, don't you?
    I think in this 1 row case it should be fetch() instead.
  • 1
    @TylerDDevRant that what I was originally using the first time, pdo wanted fetchall(), and then it decided to bitch again even though I gave it what it wanted, I’m back to using fetch() as it a single row.

    Thanks for the suggestion anyway 👍🏻👊🏻
  • 0
    The first time I encountered this error wss because someone was using the original code of a mysql db which does not allow more than one query to be "in progress", stupid as it sounds, but it is kinda like you executed a query and you got rows but didn't use all so they are still in memory I guess and it bitches about it. It sounded retarded to me then and it does so now, but the error was more regarding the way mysql is rather than pdo on my side.
Add Comment