This is mine code, I asked the end_date from the tblTest. end_date is a datetime.
Here is the code, but it give me an error:
$this->db->select(date('end_date'));
$this->db->where('topActive', 'true');
$this->db->order_by('end_date');
$this->db->group_by('end_date');
$q = $this->db->get('tblTest');
Error:
Unknown column 'UTC1107_07pm30UTC' in 'field list'
SELECT `UTC1107_07pm30UTC`
FROM (`tblTest`)
WHERE `topActive` = 'true'
GROUP BY `UTC1107_07pm30UTC`
ORDER BY `UTC1107_07pm30UTC`
What am I doing wrong?
Thanks
in your select method, you’re passing a date object. this method accepts the names of the columns that you need returned.
end_dateis your column name, so use that.UPDATE
This is the query that ended up working: