note 98358 added to pdostatement.fetchall

From: Date: Thu, 10 Jun 2010 15:50:49 +0000
Subject: note 98358 added to pdostatement.fetchall
Groups: php.notes 
Request: Send a blank email to php-notes+get-170023@lists.php.net to get a copy of this message
Error: 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. If you're using something like: while ($row = $query->fetchObject()) { [...] } try using this instead: $rows = $query->fetchAll(PDO::FETCH_CLASS, 'ArrayObject'); foreach ($rows as $row) { [...] } ---- Server IP: 69.147.83.197 Probable Submitter: 80.137.180.83 ---- Manual Page -- http://www.php.net/manual/en/pdostatement.fetchall.php Edit -- https://master.php.net/note/edit/98358 Del: integrated -- https://master.php.net/note/delete/98358/integrated Del: useless -- https://master.php.net/note/delete/98358/useless Del: bad code -- https://master.php.net/note/delete/98358/bad+code Del: spam -- https://master.php.net/note/delete/98358/spam Del: non-english -- https://master.php.net/note/delete/98358/non-english Del: in docs -- https://master.php.net/note/delete/98358/in+docs Del: other reasons-- https://master.php.net/note/delete/98358 Reject -- https://master.php.net/note/reject/98358 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#170023) next »