I'm experiencing a serious problem when I'm trying to make my CodeIgniter model comunicate with database properly.
In the answer I found in this topic I read that I shouldn't make queries like this:
$query2 = $this->db->query("SELECT patient_id FROM visits
WHERE date LIKE DATE_FORMAT('$row->date', '%Y-%m-%d') GROUP BY date");
but like that:
$this->db->select('patient_id');
$this->db->from('visits');
$this->db->like('date', "DATE_FORMAT($row->date, '%Y-%m-%d')");
Although, still can't figure out how to make it work. I'm also not sure if I used $this->db->like properly.