Solved

Query Issue: 2 form fields with min and max.

Posted on 2006-11-29
1
150 Views
Last Modified: 2013-12-24
I keep getting the error: Syntax error (Missing operator) when I add 2 forms.  

search page---

      <select name="minprice">
      <option value="1"> no min </option>
            <option value="300000"> 300,000 </option>
      </select>  max

                 <select name="maxprice">
      <option value="9999999999"> no max </option>
      <option> 400,000 </option>

action page---

SELECT reals_id, zip.zip, city.city, state.state, price
FROM reals, zip, city, state
WHERE (0=0)
      AND reals.city = city.city_id
      AND reals.state = state.state_id
      AND reals.zip=zip.zip_id
-------------------------------------------------------------------
      AND reals.price GTE '#Session.minprice#'
      AND reals.price LTE '#Session.maxprice#'
--------------------------------------------------------------------
      AND city.city LIKE '#Session.scity#%'
      AND state.state LIKE '#Session.sstate#%'
      AND zip.zip LIKE '#Session.szip#%'

It works fine without the 2 lines of code in between the dashes...
I have a hunch I need to convert string to number

Any help will be greatly appreciated.




                        
0
Comment
Question by:sjha81
1 Comment
 
LVL 24

Accepted Solution

by:
dgrafx earned 500 total points
Comment Utility
1) in your db - is the field reals.price a datatype of money?
if yes, then remove the ' ' from around the value
the only time you'd use ' ' around the value is if it's a varchar or text field.
2) are you setting your session.minprice & session.maxprice before the code shown here (on action page)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now