Updating sqlite3 and mysql code