You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE C < '3'' at line 1
Code: Select all
<?php
//generates a list box to display the rows of available houses in the soldhouses table depending on which one the user clicks on then clicks buy will be "should be" the one that goes to the session
$CountNames = ("SELECT *, count(BusinessType) as C FROM `businesses` GROUP BY BusinessType WHERE C < '3'");
$findbusinessresult = mysql_query($CountNames) or die(mysql_error());
echo '<br><br><center><select name="businesslist" size=10>">';
Echo'<option value =""><b><u>Business Types</b></u></option>';
while($row = mysql_fetch_array($findbusinessresult)) {
echo "<option value=\"{$row['BusinessType']}\">{$row['BusinessType']}</option>";
}
echo '</select></center>';
?>