Search with multiple drop down boxes
I have a search pege in my website.I am developing in PHP/MYSQL.
search page contains three drop down boxes
Country contains:All,US,Canada etc
Education Contains:All,Highschool etc
How can i write sql statement to satisfy this criteria to get values from database.
Thank you so much for your help
Use AND in your Where clause
If "All" is chosen for any drop-down, exclude that from the WHERE clause. Since any (or all) of the items may be "All" you will need to make sure that your first "where" condition uses "WHERE" and not "AND" (e.g., if the user chose "All" for Country, then the statement would be "WHERE education=..." not "AND education=...")
Select * from TABLE
WHERE country = <selected country>
AND education = <selected education>
AND age = <selected age>
I think I can help you with this one because I done one like this. just checj here if it's the way you want. in my case you can choose one OR more critery t do your search.. here's the link
rigth now I try to expend this search to an other level.. but got some problem... I will post it on an other thread.
so let me know if it's what you want. if yes drop me a mail I will send you the code for them
hope it will help
hi thanks for your reply
i am looking exact search form like you.
can you please send me the code.
Thank you so much
hi!! check this thread..
you can took the 2 first batch of code it's my files
The code you have produced is exactly what I am looking for
Can you please send me your code please. I would like to narrow a user result depending on the criteria they choose via the drop down menu.
I really appreciate your help with this
hi!! jsut go in the thread I post before. copy clip the code into your file and VOILA.
I got confused because you said you got a error
did you modify all the php code
just confused can you zip and send me the files please
if not then no problem
thanks for your response
the first 2 files are in working condition like they are in the site rigth now. the non working one are after.
PS: I don't send any file by mail due to some problem in the past on other forum.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)