Welcome Guest, Not a member yet? Register   Sign In
Between Clause in where condition
#4

[eluser]darkhouse[/eluser]
I've actually wanted a feature like this, so that I could do something like

Code:
$this->db->where_between('id', 100, 200);

Though I've just done what Mike said to do and never had a problem.

I don't think it's a simple feat to extend the active record class, but what if you made a helper function that was like this:

Code:
function where_between($field, $min, $max){
     $CI = get_instance();
     return $CI->db->where("$field BETWEEN $min AND $max");
}


Messages In This Thread
Between Clause in where condition - by El Forum - 12-17-2008, 05:32 AM
Between Clause in where condition - by El Forum - 12-17-2008, 06:46 AM
Between Clause in where condition - by El Forum - 12-19-2008, 11:44 PM
Between Clause in where condition - by El Forum - 12-26-2008, 04:35 PM
Between Clause in where condition - by El Forum - 12-26-2008, 04:43 PM
Between Clause in where condition - by El Forum - 04-27-2011, 12:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB