Updated the code. Bad practice with using mysql...And nothing useless with sqlite