Hi
I have connected to mysql database and am displaying results but I want to display the results based on what the user searches for as its a property website, at the moment, the coding is returning all the results in the mysql database
Please help, been at it for days now trying to get it to work correctly
The coding is below
[php]
You have searched for a <?php echo $_POST["propertytype"]; ?>You have searched in the location of <?php echo $_POST["location"]; ?>
You have searched for <?php echo $_POST["bedrooms"]; ?> bedrooms
You have searched for <?php echo $_POST["bathrooms"]; ?> bathrooms
You have searched for £<?php echo $_POST["minprice"]; ?>
You have searched for £<?php echo $_POST["maxprice"]; ?>
Please find your results below
<?php
$db=mysql_connect(“host”, “user”, “password”);
mysql_select_db(“database”, $db);
$db = mysql_select_db(“database”) or die (“Couldnt select database”);
?>
"; trigger_error(mysql_error()); } elseif(!mysql_num_rows($result)) { // no records found by query. echo "No records found"; } else { $i = 0; echo '
\n
"; echo "" . $row['id'] . "
\n"; // Where 'id' is the column/field title in the database echo "Property Type: ". $row['typeProperty'] . "
\n"; // as above echo "Bedrooms: ". $row['bedrooms'] . "
\n"; // .. echo "Bathrooms: ". $row['bathrooms'] . "
\n"; // .. echo "Garden: ". $row['garden'] . "
\n"; // .. echo "Description: ". $row['description'] . "
\n"; // .. echo "Price: ". $row['price'] . "
\n"; // .. echo "Location: ". $row['location'] . "
\n"; // Where 'location' is the column/field title in the database echo '