title: CodeIgniter: Undefined property: stdClass::$date
body: <p>I'm experiencing a serious problem when I'm trying to make my CodeIgniter model comunicate with database properly.</p>
  
  <p>In the answer I found <a href="https://stackoverflow.com/questions/9792814/codeigniter-message-undefined-property-stdclass">in this topic</a> I read that I shouldn't make queries like this:</p>
  
  <pre><code>            $query2 = $this-&gt;db-&gt;query("SELECT patient_id FROM visits
                            WHERE date LIKE DATE_FORMAT('$row-&gt;date', '%Y-%m-%d') GROUP BY date");    
  </code></pre>
  
  <p>but like that:</p>
  
  <pre><code>$this-&gt;db-&gt;select('patient_id');
  $this-&gt;db-&gt;from('visits');
  $this-&gt;db-&gt;like('date', "DATE_FORMAT($row-&gt;date, '%Y-%m-%d')"); 
  </code></pre>
  
  <p>Although, still can't figure out how to make it work. I'm also not sure if I used $this->db->like properly.</p>