title: Unknown column 'dd' in 'field list' while using DATE_FORMAT in codeigniter
body: <p>I am fetching date form data base. So i have to change the date format.
  So i have used <code>DATE_FORMAT</code> but it gives me the error:</p>
  
  <blockquote>
    <p><strong>Unknown column 'dd' in 'field list'</strong></p>
  </blockquote>
  
  <p>How can I format the Date while fetching the data form database.</p>
  
  <p>Date formate in datebase: <strong><code>YYYY-mm-dd</code></strong>
  Wanted Date Formate     : <strong><code>dd-mm-YYYY</code></strong></p>
  
  <pre><code>SELECT DATE_FORMAT
  (date_add(CURDATE(), interval (credit_validity_duration*30) day), dd-mm-YYYY) as max_credit_valid_date, 
  date_add(CURDATE(), interval (app_d_validity_duration*30) day) as max_add_d_validity_date, 
  date_add(CURDATE(), interval add_b_validity_duration day) as add_b_validity_duration, 
  ,`id` FROM `app_table` WHERE `user` = 'A'
  </code></pre>
  
  <p>This is the Codeigniter Active record query:</p>
  
  <pre><code>$this-&gt;db-&gt;select( 
                  DATE_FORMAT(date_add(CURDATE(), interval (credit_validity_duration*30) day), dd-mm-YYYY) as max_credit_valid_date, 
                  date_add(CURDATE(), interval (app_d_validity_duration*30) day) as max_add_d_validity_date, 
                  date_add(CURDATE(), interval bonus_validity_duration day) as bonus_validity_duration, 
                  ,id
              );
  $this-&gt;db-&gt;from('app_table');   
  $this-&gt;db-&gt;where('user', "A" );
  $query = $this-&gt;db-&gt;get();
  </code></pre>