Bug 187681 - Php pdo sqlite can't open sqlite command-line created databases
Php pdo sqlite can't open sqlite command-line created databases
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: php-pear (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
http://firman.dotgeek.org/item/20
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-02 12:28 EDT by Federico
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-04-03 04:19:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Federico 2006-04-02 12:28:25 EDT
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 04:19:59 EDT
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.