MySQL connection class with query method.