note 95990 rejected from pdo.constants by danbrown

From: Date: Mon, 01 Feb 2010 23:04:02 +0000
Subject: note 95990 rejected from pdo.constants by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-165581@lists.php.net to get a copy of this message
Note Submitter: Typer85 at gmail dot com ---- 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,

« previous php.notes (#165581) next »