in phpmyadmin i can run this query
Select * from tbl_member where id_group= 'value' and TIMESTAMPDIFF(YEAR, birthday, CURDATE()) BETWEEN '0' and '19'
but in my model i cannot run this query
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->db->select('*');
$this->db->from('tbl_member');
$this->db->where('id_group',$id_group);
$this->db->where($condition);
$query = $this->db->get();
return $query;
}
}
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?