note 74262 added to function.PDOStatement-fetch

From: Date: Mon, 02 Apr 2007 11:41:23 +0000
Subject: note 74262 added to function.PDOStatement-fetch
Groups: php.notes 
Request: Send a blank email to php-notes+get-125014@lists.php.net to get a copy of this message
Be careful with fetch() when you use prepared statements and MySQL (I dont know how it is with other databases). Fetch wont close cursor and won`t let you send any other query, even if your result set has only one row, . If you use $statement->fetch(), you will also have to use $statement->closeCursor() afterwards, to be albe to execute another query. Alternatively you can use $statement->fetchAll() without $statement->closeCursor(). ---- Server IP: 195.136.184.34 Probable Submitter: 83.17.2.186 ---- Manual Page -- http://www.php.net/manual/en/function.PDOStatement-fetch.php Edit -- https://master.php.net/note/edit/74262 Del: integrated -- https://master.php.net/note/delete/74262/integrated Del: useless -- https://master.php.net/note/delete/74262/useless Del: bad code -- https://master.php.net/note/delete/74262/bad+code Del: spam -- https://master.php.net/note/delete/74262/spam Del: non-english -- https://master.php.net/note/delete/74262/non-english Del: in docs -- https://master.php.net/note/delete/74262/in+docs Del: other reasons-- https://master.php.net/note/delete/74262 Reject -- https://master.php.net/note/reject/74262 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#125014) next »