Hi
I'm having problems with a query bringing back records where the price is between 2 different min and max options.
My field in the db = prop_price and it is currently an integer (as I thought part of the problem might be the comma in the prices)
I've pasted here the 2 form fields - prop_pricemin and prop_pricemax.
<td align="left"><label for="prop_pricemin"></label>
<select name="prop_pricemin" id="prop_pricemin">
<option value="<?php echo $_POST['prop_pricemin']; ?>" selected="selected"><?php echo $_POST['prop_pricemin']; ?></option>
<option value="Any">Any</option>
<option value="100000">100000</option>
<option value="500000">500000</option>
<option value="1000000">1000000</option>
<option value="1500000">1500000</option>
<option value="1500000">1500000</option>
</select>
</tr>
<tr>
<td> </td>
<td align="left"><label for="prop_pricemax"></label>
<select name="prop_pricemax" id="prop_pricemax">
<option value="<?php echo $_POST['prop_pricemax']; ?>" selected="selected"><?php echo $_POST['prop_pricemax']; ?></option>
<option value="Any">Any</option>
<option value="1000000">1000000</option>
<option value="1500000">1500000</option>
<option value="2000000">2000000</option>
<option value="3000000">3000000</option>
<option value="3000000+">3000000+</option>
</select>
This is what I have in my sql query :
WHERE property_details.prop_price <= '$_POST[prop_pricemin]'
AND property_details.prop_price >= '$_POST[prop_pricemax]'
I feel reasonably sure about the query and something is telling me that it doesn't like the way I have the prices in the database?
I would also really like the prices to have the comma but dont'know if that is stopping the math function working?
Any help would be great
Many thanks