執行此代碼時,它給出了一個我不知道的錯誤消息。我做了goooooogle,但我沒有找到任何解決方案。注意:試圖獲取非對象的屬性在C: xampp htdocs
**注意:試圖讓非對象的屬性在C:\ XAMPP \ htdocs中**
<?php
$_REQUEST['PropertyID'];
$_REQUEST['PropertyImageID'];
$propertyImageID=$_GET['PropertyImageID'];
$PropertyID=$_GET['PropertyID'];
require_once('db.php');
$propertyquery = "SELECT PropertyImageID, PropertyName, PropertyStatus, PropertyLocation, PropertyRegion FROM properties WHERE PropertyImageID =$propertyImageID";
$propertyquery_run = $connection->query($propertyquery);
if ($propertyquery_run-> num_rows > 0)
{
while ($propertyrow = $propertyquery_run-> fetch_assoc())
{
$imagequery = "SELECT PropertyImageID, ImagePath FROM propertyimages WHERE PropertyImageID = $PropertyID";
$imagequery_run = $connection->query($imagequery);
?>
<table style="margin-left:348px;">
<tr><td>PropertyName:</td><td><span style="color:#0F0; font-weight:bold;"><?php echo htmlentities($propertyrow['PropertyName']) ?></span></td></tr>
<tr><td>PropertyStatus:</td><td><span style="color:#0F0; font-weight:bold;"><?php echo htmlentities($propertyrow['PropertyStatus']) ?></span></td></tr>
<tr><td>PropertyLocation:</td><td><span style="color:#0F0; font-weight:bold;"><?php echo htmlentities($propertyrow['PropertyLocation']) ?></span></td></tr>
<tr><td>PropertyRegion:</td><td><span style="color:#0F0; font-weight:bold;"><?php echo htmlentities($propertyrow['PropertyRegion']) ?></span></td></tr>
</table>
<center>
<?php
if($imagequery_run -> num_rows > 0)
{
while ($imagerow = $imagequery_run-> fetch_assoc())
{
?>
<div style="border:solid 2px #9F0; border-radius:5px; height:222px; width:544px;">
<img src="<?php echo htmlentities($imagerow['ImagePath']) ?>" width="544" height="222" >
</div><br />
<?php
}
}
}
}
?>
您是否有錯誤的行號? – ibi0tux 2013-04-23 09:08:09
那麼,當你初始化'$連接'?而且,頂部的'$ _REQUEST'行也沒用。 ^^ – Jon 2013-04-23 09:08:59
如果你使用mysqli,那麼你一次只能做1個查詢 – Waygood 2013-04-23 09:09:04