fuel_model() ++ Where clause ++ how to filter 2 values in the same column?

edited July 2017 in Modules
Hi,
I have this fuel_model() call that works:

$event_list = fuel_model('events', array('where' => array( 'event_type <>' => 'value1')));

BUT WHEN I want to filter a second value in the same column, only the second value is used.

$event_list = fuel_model('events', array('where' => array( 'event_type <>' => 'value1', 'event_type <>' => 'value2')));

HOW DO I WRITE THIS CALL?
Thanks!!

Comments

  • edited 7:35AM
    Any luck with?:
    $event_list = fuel_model('events', array('where' => "event_type NOT IN ('value1','value2')"));
  • edited 7:35AM
    Hi that works! Thanks.

    BTW - And when I have to combine it with values from variables I can do that too.
    For example:

    $event_list = fuel_model('events', array('where' => "event_type NOT IN ('value1','value2') AND date_end < '$date'"));

    Have a great day!
Sign In or Register to comment.