Вот моя модель `
Код: Выделить всё
{
$query = $this->db->query('SELECT Sum(dfp_oral_qty) FROM daily_family_planning_register WHERE YEAR(dfp_date) = (YEAR(NOW()))');
echo ($query->result_array());
}
Вот мой контроллер
Код: Выделить всё
$data['count_oral_pills_this_year'] = $this->referral->count_oral_pills_this_year();
Код: Выделить всё
-->
Спасибо
п>
Подробнее здесь: https://stackoverflow.com/questions/447 ... -using-sum
Мобильная версия