Hello guys
Ive been playing around with the script below and cant seem to get it to work, ive managed to do a few thing with it but one things i cant seem to do is to get the results into a looping table. The table must be clickable. Can anyone help?
<?php
if (
isset($_POST['keyword']) ||
isset($_POST['propertytype']) ||
isset($_POST['rent_min']) ||
isset($_POST['rent_max']) ||
isset($_POST['bedrooms_min']) ||
isset($_POST['bedrooms_max']))
{
$mysqldb = new mysqli("localhost", "root", "850303", "propertyvid");
$field = $_POST['propertytype'];
$rent_min = $_POST['rent_min'];
$rent_max = $_POST['rent_max'];
$bedrooms_min = $_POST['bedrooms_min'];
$bedrooms_max = $_POST['bedrooms_max'];
if (
isset($_POST['keyword']) ||
isset($_POST['propertytype']) ||
isset($_POST['rent_min']) ||
isset($_POST['rent_max']) ||
isset($_POST['bedrooms_min']) ||
isset($_POST['bedrooms_max'])) {
$result= $mysqldb->query("SELECT id, User_Name, Property_Details, To_Rent_Price FROM to_rent WHERE City= '$keyword'");
}
else {
echo "Invalid search criteria has been entered";
}
echo "<table>
<tr>
<td>id</td>
<td>User Name</td>
<td>To Rent Price</td>
<td>Property Details</td>
</tr>";
if ($result->num_rows > 0 ) {
while ($row = $result ->fetch_object()) {
echo "<tr><td><a href=\"details.php?classified_id=" . $row->id . "\"></td>
<td>" . $row->User_Name . "</td><td>" . $row->To_Rent_Price . "</td><td>" . $row->Property_Details . "</td></a></table><br /><br />";
}
} else {
echo "No results found.";
}
}
?></div>
</body>
</html>