I have a question about this line of codeam using Joomla's JDatabaseQuery methods to select some columns from two joined tables, see belowbut I don't understand something about the following snippet.
//Initialize variables.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
//Create the base select statement.
$query->select('a.id as id, a.greeting as greeting, a.published as published')
->from($db->quoteName('#__diolegend','a'));
//Join over the categories.
$query->select($db->quoteName('c.title' ,'category_title'))
->join('LEFT',$db->quoteName('#__categories','c')
. ' ON c.id =a.catid');
$query->select($db->quoteName('c.title' ,'category_title'))->join('LEFT',$db->quoteName('#__categories','c') . ' ON c.id =a.catid');
See in the 2nd select()
, there is no mention of a.catid
?
How can it be possible to still retrieve a.catid, wea.catid
? We haven't selectselected it from anywhere...
Thank you everybody