WARNING: sqlite3 function is deprecated and will be removed in PHP5.5, switch to PDO sqlite


The SQLite3 module available to customers in /app/ is a custom installation.  The sample code below allows a user to open, insert, and select from a sqlite3 database. API documentation is available here:  http://php-sqlite3.sourceforge.net/pmwiki/pmwiki.php/Main/API

<?php

dl('sqlite3.so');

$db = sqlite3_open('mysqlite3db.db');

sqlite3_exec($db, "CREATE TABLE foo (bar STRING)");

sqlite3_exec($db, "INSERT INTO foo (bar) VALUES ('This is a test')");

$res = sqlite3_query($db, "SELECT bar FROM foo");

$array = sqlite3_fetch_array($res);

print_r($array);

?>