php - Multiple AND, OR statements -


hello know if following code extended 'and', 'or' statement or need 'if' statement ?

if (in_array("juliette_geinformeerd", $opts)){ $where .= " , juliette_geinformeerd = 1 "; } 

i tryed:

if (in_array("juliette_geinformeerd", $opts)){ $where .= " , juliette_geinformeerd = 1 " . "or juliette_geinformeerd = 2"; } 

but doesnt work.

//update:

so piece of code works toghether ajax. if click checkbox updates page , filters options. filter on multiple statements instead of 1 (yes or no).

    if (in_array("juliette_geinformeerd", $opts)){     $where .= " juliette_geinformeerd = 1 " . "or juliette_geinformeerd = 2";     } // if there no other conditions in if there condition try write that:   $where .="('juliette_geinformeerd_else = 1";        if (in_array("juliette_geinformeerd", $opts)){         $where .= "and juliette_geinformeerd = 1) " . "or juliette_geinformeerd = 2";         } 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -