Updated database connection to use JSON and MySQL