title: CodeIgniter : How to write timestampdiff query in models codeigniter?
body: <p>in phpmyadmin i can run this query</p>
  
  <pre><code>Select * from tbl_member where id_group= 'value' and TIMESTAMPDIFF(YEAR, birthday, CURDATE()) BETWEEN '0' and  '19'
  </code></pre>
  
  <p>but in my model i cannot run this query</p>
  
  <pre><code>class Member_m extends CI_Model {
  
      function select_member($id_group,$age_min,$age_max){
          $condition = " TIMESTAMPDIFF(YEAR, birthday, CURDATE()) BETWEEN '".$age_min."' and '".$age_max."' ";
          $this-&gt;db-&gt;select('*');
          $this-&gt;db-&gt;from('tbl_member');
          $this-&gt;db-&gt;where('id_group',$id_group);
          $this-&gt;db-&gt;where($condition);
          $query = $this-&gt;db-&gt;get();
  
          return $query;
      }
  }
  </code></pre>
  
  <p>I tried to take a member of the minimum age to the age of maximal, for example, I wanted to take the members of the member from the age of 10 years up to the age of 19 years .. any one can help me?</p>