PDO “Uncaught exception 'PDOException' .. Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll().”

前端 未结 3 421
萌比男神i
萌比男神i 2021-01-17 17:56

I know this question has been asked many times, but I\'ve read the answers to many of the questions and still cannot understand why I am receiving this error:

3条回答
  •  庸人自扰
    2021-01-17 18:42

    After struggling with this issue for days, I finally found that this worked for me:

    $db = new PDO ($cnstring, $user, $pwd);
    $db->setAttribute (PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
    

提交回复
热议问题