Название таблицы: бренд < /p>
Код: Выделить всё
id | brand
1 | UNIQLO
2 | PDI
3 | PDI
4 | H&M
5 | UNIQLO
< /code>
Результат, который мне нужен: < /p>
PDI x 2
UNIQLO x 2
H&M x 1
< /code>
Я попробовал это: < /p>
$this->db->select('brand, count(*) as TOTAL');
$this->db->from('brand');
$this->db->group_by('id');
$query = $this->db->get();
return $query->result();
Подробнее здесь: https://stackoverflow.com/questions/288 ... ive-record