Hello,
I am trying to make a little database search utility for a small real estate list. One feature that I can not get to work is: Search Between. If you user inputs a low end limit like $100,000 and a high end limit like $300,000 – I would like the results to show only properties that fall between that price range. Here is what I have working so far:
<table width="90%" border="0" align="center" cellpadding="6" cellspacing="0">
<tr align="center" bgcolor="#6697B2">
<td> </td>
<td class="blacklink">Sale / Lease</td>
<td class="blacklink">Village</td>
<td class="blacklink">Asking Price</td>
<td class="blacklink">Bedrooms</td>
<td class="blacklink">Bathrooms</td>
<td> </td>
</tr>
<?
include ("config.inc.php");
$result = mysql_query("select * from properties where
sale_lease like '%$sale_lease%' and category like '%$category%' and view like '%$view%' and village like '%$village%' and bedrooms like '%$bedrooms%'
and bathrooms like '%$bathrooms%' limit $offset,$limit");
while ($b = mysql_fetch_array($result)) {
printf( "
<tr align=\"center\" bgcolor=\"%s\">
<td><a href=\"%s?propid=%s\"><img src=\"images/view.gif\" width=\"130\" height=\"18\" border=\"0\"></a></td>
<td class=\"body\">%s</td>
<td class=\"body\">%s</td>
<td class=\"body\">%s</td>
<td class=\"body\">%s</td>
<td class=\"body\">%s</td>
<td><a href=\"%s?propid=%s\"><img src=\"%s\" border=\"0\"></a></td>
</tr>\n", $rowcolor, $file, $b[propid], $b[sale_lease], $b[village], $b[asking_price], $b[bedrooms], $b[bathrooms], $file, $b[propid], $b[photo_thumb]);
if ($rowcolor == $color1) {$rowcolor = $color2;}
elseif ($rowcolor == $color2) {$rowcolor = $color1;}
}
echo "
</table><br> <table width=\"90%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td><span class=\"bodytitleboldred\">$numrec</span><span class=\"bodybold\"> Results Found</span></td>
</tr>
</table>";
Thank you for any help you may offer