This is my hotel.php i need to make filter system to display according to filter . For example select price i need to display item within the range option given .
<!DOCTYPE html>
<html>
<head>
PHP
</head>
<body>
<form action="hotelprocess.php" method="POST">
<p>
<select name="Photel">
<option>Select-Price-</option>
<option value="price">100-300</option>
<option value="price">301-500</option>
</select>
</p>
<p>
<input type="submit" name="hotel" />
</p>
</form>
</body>
</html>
This is my hotelprocess.php In this file i want make it to display item from database according the the filter system . I used if below to make sure can display the message but it fail . It has error that say Parse error: syntax error, unexpected '$prc' (T_VARIABLE) in C:\xampp\htdocs\Test\hotelprocess.php on line 4
<?php
include 'dbh.php'
//Get value pass from form in hotel.php file
$prc = $_POST["prc"];
$prc = mysql_real_escape_string($pass);
//DB
$query = "SELECT h_price, n_hotel FROM hotel";
$result=mysqli_query($conn, $query);
$rows = mysqli_fetch_array($result);
if($row['prc'] > 0)
{
echo "hello";
}
else{
echo "failed to display";
}
?>
This is connetion to database
<?php
//connect with database
$conn=mysqli_connect("localhost", "root", "", "register");
if(!$conn){
die("connection failed:".mysqli_connect_error());
}
?>
I hope you guys understand what i ask and sorry for my english .