Use JDatabase instead of MySQL queries
Correct query format
Correct query format
Merge pull request #1020 from fastslack/mysql-fix

Use JDatabase instead of MySQL queries
Merge remote-tracking branch 'joomla/staging'