note 95991 added to pdostatement.fetch

From: Date: Mon, 01 Feb 2010 23:03:02 +0000
Subject: note 95991 added to pdostatement.fetch
Groups: php.notes 
Request: Send a blank email to php-notes+get-165580@lists.php.net to get a copy of this message
Here is quick note for developers that use the PDO SQLite Driver: The PDO SQLite driver does not support cursors, so using the PDO::CURSOR_SCROLL Attribute, will not work when using the PDO SQLite driver. For example: <?php // Assuming $Handle Is a PDO Handle. $Statement = $Handle->query( $sqlStatement , array( PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL ) ); ?> What is even worse is that PDO::prepare will NOT throw an Exception when it fails to prepare the query, even when the error mode is set to throw Exceptions, and will instead return a Boolean False! Not only do I consider this a poor design choice, but also its a real shame that this is not documented anywhere in the manual -- in fact the manual is not clear on what Attributes are supported by which drivers and which are not so developers are left to play a classic game of guess. I hope this saves some developers some headaches. Good Luck, ---- Server IP: 69.147.83.197 Probable Submitter: 217.54.224.164 ---- Manual Page -- http://www.php.net/manual/en/pdostatement.fetch.php Edit -- https://master.php.net/note/edit/95991 Del: integrated -- https://master.php.net/note/delete/95991/integrated Del: useless -- https://master.php.net/note/delete/95991/useless Del: bad code -- https://master.php.net/note/delete/95991/bad+code Del: spam -- https://master.php.net/note/delete/95991/spam Del: non-english -- https://master.php.net/note/delete/95991/non-english Del: in docs -- https://master.php.net/note/delete/95991/in+docs Del: other reasons-- https://master.php.net/note/delete/95991 Reject -- https://master.php.net/note/reject/95991 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#165580) next »