Converting sqlite2 to sqlite3 commands for PHP 5.4 compatibility