Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

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 11:43AM
    Any luck with?:
    $event_list = fuel_model('events', array('where' => "event_type NOT IN ('value1','value2')"));
  • edited 11:43AM
    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.