How do I know if PHP is compiled with SQLite support? If it's not, and I don't have the privileges to change it, what alternatives do I have to read an SQLite database besides access to php-sqlite3 functions?
PHP provides two SQLite extensions by default since version 5.0. The latest SQLite extension is known as sqlite3 extension that is included in PHP 5.3+.
Connect to Database php class MyDB extends SQLite3 { function __construct() { $this->open('test. db'); } } $db = new MyDB(); if(! $db) { echo $db->lastErrorMsg(); } else { echo "Opened database successfully\n"; } ?>
PDO_SQLITE is a driver that implements the PHP Data Objects (PDO) interface to enable access to SQLite 3 databases.
MySQL uses a database server to run on a network, which can then be accessed by the client. SQLite, however, is what is known as an embedded database. This means that the structure is stored on the application itself.
phpinfo();
should tell you what's compiled in. Execute that:
<?php
phpinfo();
?>
and look for sqlite within the HTML output.
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