Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Selections In List Menu In DB Search

Status
Not open for further replies.

Enviweb

ISP
Jun 1, 2002
3
0
0
US
Hi all,

Here's my situation. I set up a database for a local employment service to
search their job listings. There are four search fields. Position,
State/Location, Salary, and Key words. All work as designed except the State
search. The form element is a list menu with multiple selections checked.
The State search works only when one item is selected. The search criteria
is displayed on the results page and all selected states are delimited with
", " (e.g. Arizona, California, etc.). Now, that's the way it should be to
the best of my knowledge. Correct me if I'm wrong, but the App Server should
see the comma space and treat the string as separate queries. That leads me
to believe that the string has been appended into one query. Does anybody
have any ideas for a solution. All responses would be deeply appreciated.

SQL:
Where Location LIKE '%job_region%' AND Salary LIKE '%job_salary%' AND Title
LIKE '%job_position%' AND KeyWords LIKE '%job_words%'

Variables:
Session.Form("region")
Session.Form("salary")
Session.Form("position")
Session.Form("words")

I use MS Personal Web Server on my local machine and run the database on a
MYSQL server. I do this all the time and have not had any problems until
now. It does not work on either machine.

Thanks In Advanced,
Doug
 
"Correct me if I'm wrong, but the App Server should
see the comma space and treat the string as separate queries."
You are wrong. You would have to split it up and make it something like "(Location LIKE '%job_location[0]%' OR Location LIKE '%job_location[1]%')" etc. The easiest way would be to have a loop. Since I don't know what language you are using, I can't show you an example either. //Daniel
 
Daniel,

I stand corrected. I'm using ASP. I would appreciate an example.

Doug
 
I'm sorry, but I've never used ASP... But someone probably does and they should be able to help. Try asking in the ASP forum. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top