CodeIgniter Forums
Problem with query(BETWEEN) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Problem with query(BETWEEN) (/showthread.php?tid=5404)



Problem with query(BETWEEN) - El Forum - 01-20-2008

[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


Problem with query(BETWEEN) - El Forum - 01-20-2008

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