Solved

Query Issue: 2 form fields with min and max.

Posted on 2006-11-29
1
152 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 25

Accepted Solution

by:
dgrafx earned 500 total points
ID: 18035576
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Remove Index.php in Codeigniter 12 63
Mapping Custom Error Page in IIS 7.0 / Windows 2008 3 54
Running Guacamole on port 80 5 214
Nameserver and MX Record 2 71
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

810 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