Fixed Undefined variable: query

This was generating an Fatal error: Call to a member function select() on a non-object.

http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=30068