phpcodeigniteractiverecordwhere-clausequery-builder

Apply greater than operator or less than operator in a CodeIgniter where() method call


I am using CodeIgniter and active record. I am selecting my data over WHERE with array. Any like this. But how can I insert > and < as the comparison operator? It is possible?

$whereQuery['service.service_end_date'] = $start;

Solution

  • http://ellislab.com/codeigniter/user-guide/database/active_record.html

    $whereQuery['service.service_end_date >'] = $start;
    $whereQuery['service.service_end_date <'] = $start;
    

    You can pass > < <> in CI where function

    $this->db->where('field_name <', "Condition_value");