Update query to JDatabase format

Query updated in component.
Same here try to use `$db->q()` and `$db->qn()`