Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

search result display help

Avatar of MrFahad
MrFahad asked on
PHPMySQL Server
18 Comments1 Solution314 ViewsLast Modified:
hello,

i have made a page to display the result of a search, how ever i couldn't do it as i wanted

here is a link of how i want it: http://www.arencore.com/property.php

i will post the code i did and screen shot of the page and db info for help

and for retrieving the image, the name of the image is saved in db (imageinfo field) and it's always uploaded to uploaded_images/

so i did this code for retrieving it:

echo '<img width="159" height="113" src="uploaded_Images/';  
      echo $row['imageinfo'] . '" alt="' . $row['imageinfo'];
echo '"/></a>
<?php require_once("includes/connection.php"); ?>
<?php require_once("includes/functions.php"); ?>
<?php include("includes/header.php"); ?>
 
		<td id="page">
			<h2>Welcome to Coordination Real Estate</h2>
			<script type="text/javascript" src="javascript/container_core-min.js"></script> 
	<script type="text/javascript" src="javascript/carousel.js"></script>
 
	<link rel="stylesheet" type="text/css" href="stylesheets/base-min.css">
	<link href="stylesheets/carousel.css" rel="stylesheet" type="text/css">
	<link href="stylesheets/yui.css" rel="stylesheet" type="text/css">
 
<?php
 
		
	 $listedPrice = $_POST['listedPrice'];
        $No_bedroom = $_POST['No_bedroom'];
        $PropertyCountry = $_POST['country'];
        $PropertyCity = $_POST['cityList'];
        $PropertyType = $_POST['PropertyType'];
        $NO_bathroom = $_POST['NO_bathroom'];
 
$listtemp = explode("-", $listedPrice,2);
 
$query = "SELECT * from properties WHERE 
  listedPrice between  {$listtemp[0]} AND {$listtemp[1]} AND
  No_bedroom = $No_bedroom AND 
  PropertyCountry = '$PropertyCountry' AND 
  PropertyCity = '$PropertyCity' AND 
  PropertyType = $PropertyType AND 
  NO_bathroom = $NO_bathroom 
LIMIT 0,10;";
 
 
$query2 = mysql_query($query);
if(!$query2) die('SQL error: '.mysql_error());
 
echo '<table>';
 
while ($row = mysql_fetch_array($query2)) {
 
 
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['Propertyid'];
echo "</td><td>";
if ( $row['PropertyType'] == 1 ) {
	echo "Apratment"; } else {
		echo "Villa"; }
echo "</td><td>";
echo $row['PropertyAddress']; 
echo "</td><td>";
echo $row['No_bedroom'];
echo "</td><td>";
echo $row['ListingDate'];
echo "</td><td>";
echo $row['ListedPrice'];
echo "</td><td>";
echo $row['DateBuild'];
echo "</td><td>";
echo $row['Area'];
echo "</td><td>";
echo $row['Description'];
echo "</td></tr>";
}
echo "</table>";
 
	
 
?>
		</td>
	</tr>
</table>
<?php require("includes/footer.php"); ?>
db.jpg
result.jpg
ASKER CERTIFIED SOLUTION
Avatar of agamal
agamalFlag of United Arab Emirates image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 18 Comments.
See Answers