I am trying to get the last date for which I have the data. So I want to print the last date in my column date_data.
In Model:
public function last_record()
{
$query = $this->db->select('LAST(date_data)');
$this->db->from('date_data');
return $query;
}
In Controller:
$last_data = $this->attendance_m->last_record();
var_dump($last_data);
But I am not getting the desired result