$db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('*'); $query->from('my_table'); $db->setQuery($query); $results = $db->loadObjectList();
$jinput = JFactory::getApplication()->input; $id = $jinput->get('id', 0, 'int'); $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('*'); $query->from('my_table'); $query->where('id = '.$id); $db->setQuery($query); $results = $db->loadObjectList();In this example, we are using the loadObjectList function to retrieve data from the "my_table" table based on a specific ID value that is passed through a form submission (using the JFactory class). Once we have our results, we can display them on a details page. These examples are using the Joomla Framework or CMS as the JFactory, so it is safe to assume that this function is part of the Joomla library package.