Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP with sqlite3 support

Tags:

php

sqlite

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?

like image 289
obuzek Avatar asked Jun 30 '09 23:06

obuzek


People also ask

Does PHP support sqlite3?

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+.

How can I access SQLite database in PHP?

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"; } ?>

Does PDO work with SQLite?

PDO_SQLITE is a driver that implements the PHP Data Objects (PDO) interface to enable access to SQLite 3 databases.

What is the difference between MySQL and SQLite?

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.


1 Answers

phpinfo(); should tell you what's compiled in. Execute that:

<?php

phpinfo();

?>

and look for sqlite within the HTML output.

like image 112
karim79 Avatar answered Sep 21 '22 05:09

karim79