Welcome Guest, Not a member yet? Register   Sign In
using or_where() on same field
#13

[eluser]Armchair Samurai[/eluser]
Another solution, which doesn't require hacking the CI core. Slightly messy, but gets the job done.

Code:
$start_date = $this->db->escape($start_date);
$sql = "(gm.resign_date >= $start_date OR gm.resign_date IS NULL)";

$this->db->join('groups_members gm', 'gm.member_id = m.user_id');
$this->db->where('gm.join_date <=', $end_date);
$this->db->where($sql, NULL, FALSE);
$this->db->where('gm.group_id', $this->session->userdata('group_id'));
$this->db->order_by('last_name', 'asc');

$query = $this->db->get('members m');


Messages In This Thread
using or_where() on same field - by El Forum - 05-21-2010, 01:37 PM
using or_where() on same field - by El Forum - 05-21-2010, 02:24 PM
using or_where() on same field - by El Forum - 05-21-2010, 02:56 PM
using or_where() on same field - by El Forum - 05-21-2010, 03:09 PM
using or_where() on same field - by El Forum - 05-21-2010, 03:15 PM
using or_where() on same field - by El Forum - 05-21-2010, 03:24 PM
using or_where() on same field - by El Forum - 05-21-2010, 03:39 PM
using or_where() on same field - by El Forum - 05-21-2010, 04:14 PM
using or_where() on same field - by El Forum - 05-21-2010, 04:18 PM
using or_where() on same field - by El Forum - 05-21-2010, 04:29 PM
using or_where() on same field - by El Forum - 05-21-2010, 04:58 PM
using or_where() on same field - by El Forum - 05-21-2010, 05:20 PM
using or_where() on same field - by El Forum - 05-21-2010, 06:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB