Hopefully I don't have to put all my code in. I have 3 separate pages of php set up. I want a user to be able to go to my website and search a bunch of criteria to find a good school for himself. There are checkboxes, radio buttons, text boxes, etc. Here's the problem code:
$query = "SELECT * FROM post_sec_all_stats WHERE DURA_SCH=$dura_sch AND CTRL_SCH=$ctrl_sch AND POPU_AREA_SCH$popu_area_sch ORDER BY UNITID";
$result = mysql_query($query) or die("Error processing <strong>query</strong>. ".mysql_error());
And here's the form that I'm using:
<form method="post" action="school_list.php">
<input type="checkbox" value=">=11 && <=13" name="popu_area_sch"> Urban<br />
<input type="checkbox" value=">=21 && <=23" name="popu_area_sch"> Suburban<br />
<input type="checkbox" value=">=31 && <=33" name="popu_area_sch"> Town<br />
<input type="checkbox" value=">=41 && <=43" name="popu_area_sch"> Rural<br />
<br />
</form>
When I check "suburban", for example, and submit, I get this error :
Error processing query. 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 '<=23 ORDER BY UNITID' at line 1
Anybody got any suggestions? (By the way, if you can't tell, I'm super new at this. Started this whole php kick a few days ago, and am seriously addicted.) Thanks!