title: Write This Query in Codeigniter
body: <p>I need a little assistance. I need this query</p>
  
  <pre><code>SELECT *, STR_TO_DATE( end_date,  "%d/%m/%Y" ) AS DATE
  FROM  `resume_experience` 
  WHERE  `resume_id` =1
  ORDER BY DATE DESC
  </code></pre>
  
  <p>to be written in codeigniter active record format. This is what I wrote.</p>
  
  <pre><code>$result = $this-&gt;db-&gt;select('*,STR_TO_DATE(end_date,%d/%m/%Y) AS DATE')
              -&gt;from('resume_experience')
              -&gt;order_by('DATE', "desc")
              -&gt;where($where)
              -&gt;get()
              -&gt;result_array();
      return $result;
  </code></pre>
  
  <p>It is giving me the following error.</p>
  
  <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM (<code>resume_experience</code>) WHERE <code>resume_id</code> = '1' ORDER BY <code>DATE</code> desc' at line 2</p>
  
  <pre><code>SELECT *, STR_TO_DATE(end_date, `%d/%m/%Y)` AS DATE FROM (`resume_experience`) WHERE `resume_id` = '1' ORDER BY `DATE` desc
  </code></pre>
  
  <p>Any help would highly be appreciated.</p>
  
  <p>Thanks and Waiting,</p>
  
  <p>Ahmad</p>