As with any database system the first thing you must do is open a database. Since SQLite is based on files, opening a database differs very little from opening a regular file.

<?php
    
/* resource sqlite_open(string filename [, int mode [, string &error_message]]) */
    
$db sqlite_open("db.sqlite"0666$error
        or die(
"Failed to connect because: ".$error);
    
/* opened a connection to memory only database */
?>