Daily Archives: January 19, 2016

Joomla 3 – sample query of the database

Here is a snippet of code I often need to build a database query in Joomla.   <?php <?php $db = JFactory::getDbo();   $query = $db->getQuery(true); // Individual fields //$query->select($db->quoteName(array(‘firstname’, ‘lastname’)));  // or all fields $query->select(‘*’) ; $query->from($db->quoteName(‘#__free_month’)); $db->setQuery($query);   $results … Continue reading

Posted in Joomla, PHP | Leave a comment