Update query.php

Tracker: #31910
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31910&start=0