Étant donné le SQL souhaité:
SELECT * FROM #__tablename LIMIT 5
Comment utiliser $ query pour y parvenir?
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select($db->nameQuote('*'));
$query->from($db->nameQuote('#__tablename'));
$db->setQuery($query);
$rows = $db->loadObjectList();