note 95990 added to pdo.constants

From: Date: Mon, 01 Feb 2010 23:01:10 +0000
Subject: note 95990 added to pdo.constants
Groups: php.notes 
Request: Send a blank email to php-notes+get-165579@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/pdo.constants.php Edit -- https://master.php.net/note/edit/95990 Del: integrated -- https://master.php.net/note/delete/95990/integrated Del: useless -- https://master.php.net/note/delete/95990/useless Del: bad code -- https://master.php.net/note/delete/95990/bad+code Del: spam -- https://master.php.net/note/delete/95990/spam Del: non-english -- https://master.php.net/note/delete/95990/non-english Del: in docs -- https://master.php.net/note/delete/95990/in+docs Del: other reasons-- https://master.php.net/note/delete/95990 Reject -- https://master.php.net/note/reject/95990 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#165579) next »