when i select dropdown list, system just give me whole data (did not filter any thing)
Code: Select all
$mon = $_POST['val'];
}
$link = mysql_connect("localhost","root","1234");
mysql_query("Use igstore");
if($_GET['submit'] !== null){
$sql = "SELECT * FROM `creator` WHERE `title` LIKE '%$find%'";}//textbox
if($_POST['val'] !== null){
$sql = "SELECT * FROM `creator` WHERE `aprice` LIKE '$mon'";}//dropdown
$result = mysql_query($sql) or die(mysql_error());
while($_GET = mysql_fetch_array($result)){
$head = $_GET['title'];
$def = $_GET['description'];
$pric = $_GET['aprice'];
$blob = $_GET['img1'];
echo"<html>";
echo'<table height="180" width="2500">';
echo"<tr>";
echo'<td align="left">';
echo'<div class="ab">';
echo'<img src="data:image/jpeg;base64,'.base64_encode($blob).'"/ width="150px" height="150px">';
echo'</div>';
echo'</td>';
echo'<td align="right" width="1500">';
echo'<div class="container">';
echo "<a href='#'><h3>$head</h3></a>";
echo"<label class='control-label col-sm-2'><h5>$def</h5></label><br>";
echo"<label class='control-label col-sm-2'><h5>ราคา: $pric</h5></label><br><br>";
echo"</div>";
echo'</td>';
echo"</tr>";
echo'</table>';
echo'<hr width="100%">';
echo"</html>";
}
?>