I know PHP 5 already supports SQLite but for some reason I can't get it to work.
I followed the instructions from SQLite tutorial: Getting started. I also made sure that the following are not commented out from php.ini:
extension=php_pdo_sqlite.dll
extension=php_sqlite.dll.
But when I open the PHP file from localhost using Firefox, I get this error:
Fatal error: Class 'SQLiteDatabase' not found.
I'm on Windows by the way, if that info matters.
What may be the cause of this problem?
I think the class SQLiteDatabase
is from the extension sqlite
rather pdo_sqlite
. So you could enable the sqlite
extension, or use PDO instead:
<?php
$conn = new PDO('sqlite:c:/mydb.sq3');
$conn->exec('some sql query');
On Windows you need to have the following set in your ini:
extension=php_pdo.dll
extension=php_sqlite.dll
I recommend you read this page in the manual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With