Hi, I am trying to achieve a query on Joomla with the new API.
I read the documentation and there is nothing that explains how I can select a group_concat available in mysql.
Any example of how I can accomplish this is welcome.
My code so far:
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('
a.id','
a.name', 'a.licence', 'a.site', 'a.certificate', 'GROUP_CONCAT(DISTINCT b.products separator \' \')', 'GROUP_CONCAT(DISTINCT c.activities separator \' \')')));
$query->from($db->quoteName('atable', 'a'));
$query->join('INNER', $db->quoteName('btable', 'b') . ' ON (' . $db->quoteName('
a.id') . ' = ' . $db->quoteName('b.parentid') . ')');
$query->join('INNER', $db->quoteName('ctable', 'c') . ' ON (' . $db->quoteName('
a.id') . ' = ' . $db->quoteName('c.parentid') . ')');
$query->group($db->quoteName('
a.id'));
$query->order('
a.name ASC');
This didn't work.