When you call phpinfo(); do you see that the PDO functionality is enabled?

Is SQLite listed as one of the databases?

http://us.php.net/manual/en/function.phpinfo.php

Also look at your /etc/php.ini file. Assuming your binary of php is
using extensions, are the extensions for sqlite being loaded? You have
to enable them from php.ini.

Finally, you need to use the pdo syntax -- another poster pointed you to
that.

Instead of PHP, you might want to try using the Catalyst framework to
help you get an SQLite-enabled website going. http://catalyst.perl.org/
for further info, and be sure to follow the Catalyst tutorial. One
problem here is that Catalyst itself is very difficult to install and
the plugins needed for the Catlyst Tutorial are harder. In fact I think
PHP might be easier to compile, but then using Zend Framework is
terribly difficult.

Best Regards

Bob Cochran
Greenbelt, Maryland, USA



Aharon (Rony) Shapira wrote:
> I created a simple table named "books" in "library.db".
> After entering "select * from books" I saw the data that I put into it.
>
> When trying to access it through php:
> $file = "library.db";
> // open database file
>
> $handle = sqlite_open($db) or die("Could not open database");
>
> I got the following:
>
> "Could not open database"
>
>
>
> When I tried the following:
>
> $file = "library.db";
>
> // create database object
>
> $db = new SQLiteDatabase($file) or die("Could not open database");
>
> I got the following:
>
> Fatal error: Uncaught exception 'SQLiteException' with message 
> 'SQLiteDatabase::__construct() [<a 
> href='function.SQLiteDatabase---construct'>function.SQLiteDatabase---construct</a>]:
>  file is encrypted or is not a database' in 
> /home/zbfckla/public_html/Ocx.php:17 Stack trace: #0 
> /home/zbfckla/public_html/Ocx.php(17): 
> SQLiteDatabase->__construct('library.db') #1 {main} thrown in 
> /home/zbfckla/public_html/Ocx.php on line 17
>
>
>
> Once again I apologies for these silly questions.
>
> Aharon
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>   
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to