Implemented the query() method for mysql