Welcome Guest, Not a member yet? Register   Sign In
Problem with query(BETWEEN)
#1

[eluser]Sawariya[/eluser]
Hi friends i am getting problem while retrieving recods from database..here is my code...here i am getting all records from particular tables which i have specified bellow... anybody can help me...

$where = array(
'usersprofile.profile_activated'=>'show',
'users.sex'=>$gender,
'usersprofile.country'=>$country,
'usersprofile.state'=>$state,

);
$this->db->select('users.user_id,users.firstname,usersprofile.photo');
$this->db->join('usersprofile','usersprofile.user_id = users.user_id');
$this->db->orderby('usersprofile.'.$order,'desc');
$this->db->where($where);
$this->db->where($dob);
$this->db->orwhere($dob1);
return $this->db->get('users');

thanks in advance
#2

[eluser]Sawariya[/eluser]
between
--------
$dob = " date_format(dob,'%Y') between $maxage and $minage";
$dob1 = " date_format(dob,'%Y') between $minage and $maxage";




Theme © iAndrew 2016 - Forum software by © MyBB