PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
How can I get this piece of code to show the error line at the bottom of the code fragment when the conditions of the SELECT query are not met? I've tried various combinations between $result and $row and nothing seems to work...
<?
if ($_POST['propertyType']=="Flat" && $_POST['postcode']){
$result = mysql_query("SELECT * FROM property WHERE propertyType = 'Flat' AND propertyArea = '$_POST[postcode]' ORDER BY 'propertyID' ASC");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
?>
<tr>
<td>
<font face="Arial" color="#0B3A62">
<?
// Echo them out
echo "<a href=\"searchprocess.php?id=$row[propertyID]\">$row[propertyType]". ", £". $row[propertyPrice];
}
}
?>
</a>
</font>
</tr>
</td>
<br>
<br>
<p>
<font face="Arial" color="#0B3A62">
<?
// If there are no records returned, tell the user
if(empty($row)){
echo "There are no records returned for your search query.";
}
?>