This is my first question around here so be nice :)
I am trying to display data using Codeigniter and MySQL based on the current date.
Down below, there's my function from the Model.
When I use this format it works:
public function get_tables(){
$this->db->where('date','2020-04-07');
$this->db->order_by('time', 'ASC');
$query=$this->db->get('tables');
return $query->result();
}
But when I try to use the CURDATE()
function, it shows me an error on this line.
public function get_tables(){
$this->db->where(date_format('date',"YYYY-MM-DD"),'CURDATE()', TRUE);
$this->db->order_by('time', 'ASC');
$query=$this->db->get('tables');
return $query->result();
}
I'll be glad to hear why isn't it working, any suggestions to improve it will be welcomed.