So I have a table with a whole load of properties and have displayed them on a webpage. As we have a wide range I developed a filtration system. However when used you can only select one tag, but we want to devise it in a way so that you can select one tag and then another. My current code is as follows.
<h3>Advanced Search:</h3>
<table>
<tr>
<td colspan="2" style="vertical-align: top; width:50%; !important;">
<h3>Location</h3>
<div>
<a href="webpropertyloc.php?loc=Alsancak" data-ajax="false" class="ui-btn">Alsancak</a>
<a href="webpropertyloc.php?loc=Karsiyaka" data-ajax="false" class="ui-btn">Karsiyaka</a>
<a href="webpropertyloc.php?loc=Lapta" data-ajax="false" class="ui-btn">Lapta</a>
<a href="webpropertyloc.php?loc=Kayalar" data-ajax="false" class="ui-btn">Kayalar</a>
<a href="webpropertyloc.php?loc=Sadrazamkoy" data-ajax="false" class="ui-btn">Sadrazamkoy</a>
<a href="webpropertyloc.php?loc=Camlibel" data-ajax="false" class="ui-btn">Cambeli</a>
<a href="webpropertyloc.php?loc=Baspinar" data-ajax="false" class="ui-btn">Baspinar</a>
<!--<a href="property.php?loc=" data-ajax="false" class="ui-btn"></a>
<a href="property.php?loc=" data-ajax="false" class="ui-btn"></a>
<a href="property.php?loc=" data-ajax="false" class="ui-btn"></a>-->
</div>
</td>
<td style="vertical-align: top; width:25%;">
<h3>Number of Bedrooms</h3>
<div>
<a href="webpropertybed.php?bed=1" data-ajax="false" class="ui-btn">1</a>
<a href="webpropertybed.php?bed=2" data-ajax="false" class="ui-btn">2</a>
<a href="webpropertybed.php?bed=3" data-ajax="false" class="ui-btn">3</a>
<a href="webpropertybed.php?bed=4" data-ajax="false" class="ui-btn">4</a>
</div>
</td>
And it goes on with another few options the code then on the page is as follows:
<h1>Properties</h1>
<?php
$loc = $_GET["loc"];
$con = mysql_connect("localhost","Username","Password");
mysql_selectdb("db",$con);
$sql = "SELECT * FROM Properties WHERE Location='$loc' ORDER BY `Properties`.`Price` ASC";
$mydata = mysql_query($sql,$con);
echo "<h4>Location:" . $loc . "</h4><br>";
while($record = mysql_fetch_array($mydata)){
echo "<div id=\"property\">" . "<img src=\"images/" . $record['MainPic'] . "\" id=\"propimg\" align=\"left\">" . "<div id=\"text\" style=\"text-align: center; margin-right:20px;\"><h2>" . $record['Title'] . "</h2>" . $record['Ref'] . "<br/>" . "£" . $record['Price'] . "<br/>" . $record['Location'] . "<br/>" . "<a href=\"property_view.php?id=" . $record['ID'] . "\" data-ajax=\"false\" class=\"ui-btn\" id=\"button\">Details</a></div>" . "<img src=\"images/bottom-line.png\" id=\"bottomline\"></div>" . "</div>" ;
}
mysql_close($con);
?>
Any help would be greatly received. Thanks in advance!