Switch from ruby sqlite3 to php sqlite3
Add error check