Hi, im making a website, and im stuck on a page where the client would like to filter employees by multiple criterea, this works if i want to find people from leeds and london for example if(isset($_POST['town'])) { $town = join("','", $town); $data = mysql_query("SELECT * FROM emails WHERE town IN('$town')") or die(mysql_error()); } PHP: But this does NOT work when i want to find people from leeds and london, and whos coverage is national elseif((isset($_POST['town'])) && (isset($_POST['coverage']))) { $town = join("','", $town); $coverage = join("','", $coverage); $data = mysql_query("SELECT * FROM emails WHERE coverage IN('$coverage') AND town IN ('$town')") or die(mysql_error()); } PHP: the town and coverage are chosen via form, in which the checkboxes are generated dynamically. Thanks for looking and any help!
That should work if you change the order of the if branches I believe. if (isset(A)) { } elseif (isset(A) && isset(B)) { // this branch never executes } You should change to if (isset(A)&&isset(B)) { } elseif (isset(A)) { }