I would like to ask how can I filter my results by 3 dropdown list independently. For example, I will filter it by 1 dropdown and then when I select another dropdown it will refined the results same as when I select the 3rd one.
Here's my code for filtering.php:
<?php
$q=$_GET['q'];
$a=$_GET['a'];
$b=$_GET['b'];
$con = mysql_connect('localhost', 'root', '');
if (!$con)
{
die('Could not connect: ' . mysql_error($con));
}
mysql_select_db("ooh", $con);
$strSQL="SELECT * FROM files WHERE type = '".$q."' AND price = '".$a."' AND location = '".$b."'";
$rs = mysql_query($strSQL,$con);
while($info = mysql_fetch_array($rs)) {
Print "<div id='filtername' class='fluid'>";
Print "<img src='images/ad_mock4.jpg' alt=''/>";
Print "<div class='box'>";
Print "<h2>".$info['title']. "<h2>";
Print "<p>".$info['shortdescription']. "</p>";
Print "<p class='cat'><strong>Price:</strong>".$info['price'] . "</p>";
Print "<p class='cat'><strong>Duration:</strong>".$info['duration'] . "</p>";
Print "<p class='cat'><strong>Material:</strong>".$info['material'] . "</p>";
Print "<p class='cat'><strong>Type:</strong>".$info['type'] . "</p>";
Print "<p class='cat'><strong>Location:</strong>".$info['location'] . "</p>";
Print "<p class='cat'><strong>Size:</strong>".$info['size'] . "</p>";
Print "</div>";
</div>
Print "<div align='center'><a href='landingpage.php?id=".$info['id']."' class='cssbutton2'>VIEW ITEM</a></div>";
}
mysql_close();
?>