Hello guys i have two tables one contains the property info and second is images of
property. i want to Retrieve the images of property from second table by selecting the
first table one row but it fails. it just display the info of property NOT images.
any one please?
<html>
<body>
<?php
require_once('db.php');
if(isset($_POST['property']))
{
$property=$_POST['property'];
$propertyquery = "SELECT PropertyImageID, PropertyName, PropertyStatus FROM properties WHERE PropertyImageID =$property ";
$propertyquery_run= mysql_query($propertyquery);
if (mysql_num_rows($propertyquery_run) > 0)
{
while ($propertyrow = mysql_fetch_array($propertyquery_run))
{?>
<div>PropertyName: <?php echo $propertyrow['PropertyName'] ?> </div>
<div>PropertyStatus: <?php echo $propertyrow['PropertyStatus'] ?> </div>
<?php }
$imagequery ="SELECT PropertyImageID, ImagePath FROM propertyimages WHERE PropertyImageID='".$propertyrow['PropertyImageID']."'";
$imagequery_run=mysql_query($imagequery);
if(mysql_num_rows($imagequery_run) > 0)
{
while ($imagerow = mysql_fetch_array($imagequery_run))
{
?>
<div style="border:solid 2px #9F0; border-radius:5px; height:222px; width:544px;">
<img src="<?php echo $imagerow['ImagePath']; ?>" >
</div><br />
<?php
}
}
}
}
else
{
echo 'Go Back And Set Your Session.Thanks';
}
?>
</body>
</html>