note 84483 added to pdo.query

From: Date: Wed, 16 Jul 2008 10:57:23 +0000
Subject: note 84483 added to pdo.query
Groups: php.notes 
Request: Send a blank email to php-notes+get-141562@lists.php.net to get a copy of this message
If someone is suffering of the "MySQL server has gone away" problem after executing multiple queries, this is a solution that solved it for me. It's similar to the one needed for the exact same problem in mysqli. <?php $stmt=$db->prepare($query); $stmt->execute(); do { $stmt->fetch(); $stmt->closeCursor(); ++$line; } while($stmt- >nextRowset()); ?> I found this only works using prepare and execute this way, not if you directly execute the query with query(). ---- Server IP: 80.241.173.254 Probable Submitter: 89.189.42.206 ---- Manual Page -- http://www.php.net/manual/en/pdo.query.php Edit -- https://master.php.net/note/edit/84483 Del: integrated -- https://master.php.net/note/delete/84483/integrated Del: useless -- https://master.php.net/note/delete/84483/useless Del: bad code -- https://master.php.net/note/delete/84483/bad+code Del: spam -- https://master.php.net/note/delete/84483/spam Del: non-english -- https://master.php.net/note/delete/84483/non-english Del: in docs -- https://master.php.net/note/delete/84483/in+docs Del: other reasons-- https://master.php.net/note/delete/84483 Reject -- https://master.php.net/note/reject/84483 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#141562) next »