....something.....
Code:
$productname = htmlspecialchars($_POST['pname']);
$selectprice = htmlspecialchars($_POST['price']);
....something.....
Code:
$sql="select * from yourtable where productname LIKE '%$productname%'";
if($selectprice=="1") {
$sql .= " and productprice BETWEEN 1 AND 2";
}else if($selectprice=="2") {
$sql .= " and productprice BETWEEN 2 AND 3";
}else if($selectprice=="3") {
$sql .= " and productprice BETWEEN 3 AND 4";
}
....something.....
Bạn thử xem.