大家好,我有两张表,一张包含属性信息,第二张是图片
财产。我想通过选择从第二个表中检索属性图像
第一个表一行,但它失败了。它只显示属性而不是图像的信息。
请问有人吗?
<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>