#49320 [Opn->Fbk]: PDO returns null when SQLite connection fails
| From: | felipe@php.net | Date: | Sun, 06 Dec 2009 22:15:50 +0000 |
| Subject: | #49320 [Opn->Fbk]: PDO returns null when SQLite connection fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-145460@lists.php.net to get a copy of this message | ||
ID: 49320
Updated by: felipe@php.net
Reported By: brandon at brandonsavage dot net
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: All
PHP Version: 5.2.10
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2009-08-21 14:16:08] brandon at brandonsavage dot net
The version is mentioned as 5.2.10 but i tested this in 5.3.0 and it
exists there as well.
------------------------------------------------------------------------
[2009-08-21 13:45:15] brandon at brandonsavage dot net
Description:
------------
The PDO extension should either return an object or throw an exception.
However, with PDO and the SQLite driver, this does not happen.
Reproduce code:
---------------
<?php
//Use the wrong driver so the connection fails
$pdo = new PDO('sqlite2:bookstore.db');
var_dump($pdo);
Expected result:
----------------
PDOException
Actual result:
--------------
null
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49320&edit=1