I'm confused...I thought when I was using a while statement if the statement was false then it would do the actions after the }. Why is my code pulling the data from my table and displaying "There are no spaces available that match your criteria" which is after the } ?
<?php
$conn = mysql_connect("dbName", "usr", "pswd") or die(mysql_error());
$db = mysql_select_db("dbName") or die(mysql_error());
$minSqFt = (double) $_POST['minSq'];
$maxSqFt = (double) $_POST['maxSq'];
$selectProduct = $_POST['selectProduct'];
$status = 'status';
$displayAvail = 'displayAvail';
$q = "SELECT * from allPropertyList WHERE
productType = '$selectProduct' &&
rentableSqFt >= $minSqFt &&
rentableSqFt <= $maxSqFt &&
'Leased' != $status or
'Y' = $displayAvail or
'y' = $displayAvail";
$r = mysql_query($q,$conn) or die(mysql_error());
while ($row = mysql_fetch_array($r)) {
extract ($row);
print '<td><div align="center">'.$row['propertyAddress'].'</td>';
print '<td><div align="center">'.$row['suiteNumber'].'</td>';
print '<td><div align="center">'.$row['productType'].'</td>';
print '<td><div align="center">'.$row['rentableSqFt'].'</td>';
print '<td><div align="center">'.$row['rentalRate'].'</td>';
}
print '<td colspan="6">There are no spaces available that match your criteria.</span></td>';
print "</TABLE>";
?>
I can't figure it out.