I have a connection problem with sqlite_popen () with php

I have a problem with php and sqlite. I always have this warning:

Warning: sqlite_popen () [function.sqlite-open]: The file is encrypted or is not a database.

the name I am passing to connect is sqlite3 database. I don't know how to fix this?

0


a source to share


2 answers


sqlite_open () only supports sqlite2.



if you want to use sqlite3 you have to switch to PDO.

0


a source


I would assume that you have a database created with sqlite3 while the method call is expecting sqlite (version 2). Try the sqlite3 PHP API; here's the docs .

Please note that sqlite3 support is compiled to PHP 5.3.0. Then something like



$db = sqlite3_open(":memory:"); 

      

should be enough.

0


a source







All Articles