Page 1 of 1

SQLite Connection Problem

Posted: Mon Nov 29, 2004 1:57 pm
by willis3000
Hi All,

I've only started to experiment with PHP5 and SQLite lately and I ran into this problem when I try to connect to a SQLite database:


Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a database in D:\backup\wwwroot\phpbbs\categories.php on line 9
Could not open database


Here's the PHP code:

Code: Select all

$db = "./newdb.db";
$handle = sqlite_open($db) or die("Could not open database");
For the database I basically ran a bunch of simple create table statements. And it seemed to work when I tried to run sql commands in sqlite3.exe.

What seems to be the problem?

Thanks!

Will

Posted: Mon Nov 29, 2004 6:08 pm
by willis3000
I think I figured it out, PHP5 only supports sqlite2, and sqlite3 file format is incompatible with sqlite2 file format.

Make sure to use version 2 of sqlite to create the database.