I have a from by which I generate data after submitting the drop-down values of form to another page.
<form method="post" action="details.php">
<select name="Station">
<option value="All">All</option>
<option value="Home">Home</option>
<option value="Office">Office</option>
</select>
<select name="Section">
<option value="All">All</option>
<option value="Living">Living Room</option>
<option value="Dinning">Dinning Room</option>
<option value="Bathroom">Bathroom</option>
</select>
<input type="submit">
</form>
Based on the above form I have Station and Section Columns in a MySQL database with the values that I mentioned.
It works fine if I select Home from Station and Bathroom from Section, But if I select All from Station and Bathroom from Section then I get an error because I don't have a record with the value All in column named Station. Instead I have records with values Home and Office (by All I mean that both Home and Office should be generated).
My question is how to generate details of both stations when I select All from drop-down list.
In my details.php page I have:
$execItems = $conn->query("SELECT StationName, SectionName FROM profiles WHERE Station = '$Station' AND Section = '$Section'");
It works fine if I select Home or Office from Station, but if I select All from Station then it won't work because there is no value by the name of All in Station column (By All I meant that both Home and Office should be selected.).