Bug 187681 - Php pdo sqlite can't open sqlite command-line created databases
Summary: Php pdo sqlite can't open sqlite command-line created databases
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: php-pear
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact:
URL: http://firman.dotgeek.org/item/20
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-02 16:28 UTC by Federico
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-04-03 08:19:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Federico 2006-04-02 16:28:25 UTC
Description of problem:

You can't open a sqlite database from a php script if the database has been
created by the sqlite command.

Version-Release number of selected component (if applicable):

sqlite-3.3.3-1.2
php-pecl-pdo-sqlite-0.3-4.fc5

Steps to Reproduce:

1. Create a database from the command-line:
$ sqlite3 test.sql
sqlite> create table test_table(a);

2. Create a php script (script.php):
<?
$db = new PDO('sqlite:./test.sql');
$query = $db->query('select * from test_table');
$arr = $db->errorInfo();
print_r($arr);
?>

3. Run the script.
$ php script.php

Actual results:
The file format is not recognized.
Array
(
    [0] => HY000
    [1] => 1
    [2] => unsupported file format
)

Expected results:
No errors.
Array
(
    [0] =>
)

Additional info:
I think the sqlite pdo module has to be built against the last sqlite libraries.

Comment 1 Joe Orton 2006-04-03 08:19:59 UTC
php-pecl-pdo-sqlite is an old Extras package.  Update to "php-pdo" and you'll
get the PDO sqlite3 interface, which should work.


Note You need to log in before you can comment on or make changes to this bug.