Conditional Statements for Joomla 3

Removes deprecated JDatabase::query() and removed JDatabase::nameQuote()