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
Post a Comment