PHP Sqlite

Newest database extension with arguably the fastest interface between the database & PHP.

  • Bundled with PHP 5 (including library)
  • Fast and easy interface to 'flatfiles'
  • Implements most of SQL92
  • Supports both OO and procedural API
  • No daemon required
  • Enabled by default
  • Can use PHP to extend SQL language

Sqlite OO Interface


$db = new SQLite3('files.sqlite');

$db->exec('CREATE TABLE files (id INTEGER PRIMARY KEY, filename TEXT, content BLOB);');

$statement = $db->prepare('INSERT INTO files (filename, content) VALUES (?, ?);');
$statement->bindValue('filename', '');
$statement->bindValue('content', file_get_contents(''));
$result = $statement->execute();

// Either FetchArray $result or use openBlog below.


Comment above die function to fetch using openBlog

$fp = $db->openBlob('files', 'content', $id);

while (!feof($fp))
    echo fgets($fp);



Loading ...

Related Results :

  1. PHP Sqlite
Note :
  • Related Posts are generally User Blog posts.
  • or Other tutorials from other networks of
  • Any registered user can create related posts based on search term tags.

About the Author