Objective

How to make a simple query in Joomla to select one single record from one single table.

Example: Selecting all users, all fields

Define query

$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__users'));
$db->setQuery($query);

Get results: array of objects

$results = $db->loadObjectList();

Display results

echo "<pre>";
print_r($results);
echo "</pre>";


See also :

Source:

 

Keep Me Informed

Keep me informed of the latest extensions releases and offers. One email maximum per month.

Offer Me A Coffee!

If you like my work, offer me a coffee! Nick.