I tried doing searches on this in this forum and in google and got a couple of different answers, so I thought I'd post a message here. Basically, I have a dropdown box that has values set like this:
<select name="listingtype">
<option value="1">Commercial</option>
<option value="2">Residential</option>
<option value="3">Lots</option>
So when a person selects "Commercial", I want the value "1" to get stored in the db. So my first question is, how is this "1" stored? Is its storage as a string, integer, etc. dependent on how I define the column in the db?
Then, my second question is, how do I setup a SQL query string to do a search on this? Is it like this:
$searchstring = "select * from listings where listingtype=1;";
or do I need to put quotes around the number 1 like this:
$searchstring = "select * from listings where listingtype='1';";
Thanks!