title: Getting raw SQL Queries in CodeIgniter 1.7
body: <p>I'm trying to debug some code in my first serious CodeIgniter app and I can't seem to find where I can simply get the raw SQL that my ActiveRecord code just generated.</p>
  
  <pre><code>    $where  = 'DAY(`datetime_start`) = '. date('d',$day) .' AND ';
      $where .= 'MONTH(`datetime_start`) = '. date('m',$day) .'';
  
      $this-&gt;db-&gt;from('events')-&gt;where($where);
      $result = $this-&gt;db-&gt;get();
  </code></pre>
  
  <p>Thanks for the help!</p>