fixed connection error, checked if database exists, and stored query errors in my database.