I have this query:
$query
->select(array('a.id', 'a.alias', 'b.category_id', 'b.item_id', 'c.id', 'c.name', 'c.alias'))
->from($db->quoteName('#__zoo_category', 'a'))
->join('INNER', $db->quoteName('#__zoo_category_item', 'b') . ' ON (' . $db->quoteName('a.id') . ' = ' . $db->quoteName('b.category_id') . ')')
->join('INNER', $db->quoteName('#__zoo_item', 'c') . ' ON (' . $db->quoteName('b.item_id') . ' = ' . $db->quoteName('c.id') . ')')
->where($db->quoteName('a.alias') . ' = \'chubut\'');
As you can see, I'm recovering 2 alias: a.alias and c.alias. I need the browser displays 2 alias.
If I make a echo to $value->alias, the browser prints the c.alias, not the a.alias. Where is a.alias? How do I get it?
$db->setQuery($query);
$resultado = $db->loadObjectList();
foreach ($resultado as $key => $value) {
echo "alias: $value->alias";
}
... c.alias AS alias2 ...
– Krossfire Jul 16 '16 at 0:16