My environment:
PHP 5.4.7
Apache
win7
DB is sqlite.
I have already uncomment out below script
extension=php_pdo_mysql.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
extension=php_sqlite3.dll
But it still shows the Error info: Call to undefined function sqlite_open().
below is my php test code.
Anyone can help me?
<?php
phpinfo();
$db = sqlite_open('d:/testsqlite');
$rs = sqlite_query($db, 'select * from testtable');
print_r(sqlite_fetch_all($rs));
You only uncommented the extensions and it does not quarantee that it will work
You can:
Check if it’s properly loaded, by executing
phpinfo()function orphp -ion yourCLI, if it’s not then check the server error logs (apache?) probably you will get more details, why extensions is not loaded.EDIT1:
You have sqlite3 version you need to call sqlite class method statically like
sqlite3::open()
Here is query example.
And you can always can use PDO extension.
Connecting to PDO