<?php $err_msg = ""; $db_conn = sqlite_popen("/tmp/mydatabase", 0666, &$err_msg); if(!$db_conn) { trigger_error("Could not open database: (Reason: $err_msg)"); } /* Perform database operations */ ?>