title: codeigniter get_where with mysql functions in check values
body: <p>Just a question about the <code>get_where</code> function of codeigniter Active Records. I wanted to get a query which should be like this:</p>
  
  <pre><code>Select * from foo 
  where date = STR_TO_DATE('$month/$day/$year','%m/%d/%Y') 
    and time = STR_TO_DATE('$hour:$minute$ampm', '%l:%i%p')
  </code></pre>
  
  <p>Now I created a function in my model which appears like this:</p>
  
  <pre><code>public function validate_if_existing($month,$day,$year,$hour,$minute,$ampm)
  {
      $event_date = "STR_TO_DATE('$month/$day/$year','%m/%d/%Y')";
      $event_time = "STR_TO_DATE('$hour:$minute$ampm', '%l:%i%p')";
  
      $this-&gt;db-&gt;flush_cache();
      $query = $this-&gt;db-&gt;get_where('foo',array('event_date' =&gt; $event_date,'event_time'=&gt; $event_time));
  
      return $query-&gt;num_rows();
  }
  </code></pre>
  
  <p>But it returns <code>0</code> rows where I expected it to be <code>1</code>. I tried to check the <code>$event_date</code> and <code>$event_time</code> contents and it just appears exactly as I expected. Like this:</p>
  
  <pre><code>STR_TO_DATE('01/01/2012','%m/%d/%Y')
  </code></pre>
  
  <p>Am I doing this wrong? Anyway to solve this out?</p>