How to use IN with where clause

How to use IN with where clause

ziv@kpmbro.comziv@kpmbro.com Posts: 73Questions: 28Answers: 4

Hi Allan.

How can i use the where function on the server side with "IN" ?

my code example:

$this->editor_instance->where("user_id","123");

should be something like this:

$this->editor_instance->where("user_id","123,456,7878","IN");

I prefer not to do multiple conditions ( user_id = 123 || user_id = 456 .... ).

is it possible?

Thanks

This question has an accepted answers - jump to answer

Answers

  • ziv@kpmbro.comziv@kpmbro.com Posts: 73Questions: 28Answers: 4
    Answer ✓

    found it :)

        $this->editor_instance->where( function ( $q ) use ($table_params) {
                         $q->where( $table_params['general_settings']['client_hash_field_to_match'], '('.$table_params['general_settings']['xsha'].')', 'IN', false );
                } );
    
This discussion has been closed.