Код: Выделить всё
MySQL
select distinct(year(Cataloged_Date)) from records;
+------------------------+
| (year(Cataloged_Date)) |
+------------------------+
| 2009 |
+------------------------+
1 row in set (0.00 sec)
PHP / CodeIgniter
foreach ($query->result() as $show) {
$data[$i] = $show->Cataloged_Date;
$i++;
}
Подробнее здесь: https://stackoverflow.com/questions/180 ... ning-selec
Мобильная версия