Welcome Guest, Not a member yet? Register   Sign In
Split active record with if else statement
#2

[eluser]danmontgomery[/eluser]
Code:
$this->db
    ->select('*')
    ->where('this_column', 'that')
    ->where('that_column', 'other');

if($statement){
    $this->db->like('another_column', 'blah');
}

$q = $this->db->get('projects');

if($q !== FALSE && $q->num_rows() > 0){
    return $q->result();
} else {
    return FALSE;
}


Messages In This Thread
Split active record with if else statement - by El Forum - 08-02-2011, 10:06 AM
Split active record with if else statement - by El Forum - 08-02-2011, 11:54 AM
Split active record with if else statement - by El Forum - 08-02-2011, 12:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB