I currently have a table that holds the region information. The regions are as follows:
- Statewide - 2 results
- North - 4 results
- South - 4 results
- East - 3 results
- West - 7 results
Currently, when a user selects Statewide, they get the result from Statewide. But logically it would make more sense if the results were displayed from all the other regions as well because they are a part of the state. Currently, it is only showing 2 results but it should show 20 results
Also, if someone selects East they should see the results from the name of the Region + Statewide. So if someone selects East, the result should be from East + Statewide. It is currently showing 3 Results instead of 5 Results
Can someone please help me with this? Your help will be much appreciated.
I have tried AND, OR, XOR and UNION statements but none of them seems to work.
if (!empty($region_name)) {
if($region_name !== 'Statewide'){
$venueArray[] = " AND (REGION = '$region_name' ) XOR ( REGION = '$statewide')";
}else if($region_name == 'Statewide'){
$venueArray[] = " AND (REGION = '$region_name' ) XOR ( REGION != '$statewide')";
} else{
$venueArray[] = " AND (REGION = '$region_name')";
}
}
Lines 1 - 10 /search.php