Basically, I have a drop-down menu that has two options - 'All' & 'Top Rated'.
<select class="dropdown">
<option value="all">All</option>
<option> value="toprated">Top Rated</option>
</select>
I want to run this query through the 'All' option...
$myQuery = "SELECT Attraction.*, Type.TypeName, Rating.RatingUrl ";
$myQuery .= "FROM Attraction ";
$myQuery .= "INNER JOIN Type ON Attraction.Type = Type.TypeID ";
$myQuery .= "INNER JOIN Rating ON Attraction.AttractionID = Rating.AttractionID ";
$myQuery .= "WHERE Attraction.Type = 4 ";
$myQuery .= "ORDER BY Name ";
$result = mysql_query($myQuery);
if (!$result) {
die('Query error: ' . mysql_error());
}
And the this query through the 'Top Rated' option...
$myQuery = "SELECT Attraction.*, Type.TypeName, Rating.RatingUrl ";
$myQuery .= "FROM Attraction ";
$myQuery .= "INNER JOIN Type ON Attraction.Type = Type.TypeID ";
$myQuery .= "INNER JOIN Rating ON Attraction.AttractionID = Rating.AttractionID ";
$myQuery .= "ORDER BY Rating DESC, Name ";
$result = mysql_query($myQuery);
if (!$result) {
die('Query error: ' . mysql_error());
}
Can anyone generate the php structure I would need for this to work...
If anyone can help that would be great!