Page 1 of 1

How to make a search form for multiple values

Posted: Fri Oct 16, 2009 9:01 pm
by mikes1471
Hi Guys

I want to create a user search form on one page and to display the values/users on the following page.

The search page will be made up mainly of drop down lists such as Gender, minimum age, maximum age, location etc, basically the same old form you find on a dating/social networking website.

I need someone to tell me the steps involved as I'm unsure how to display user defined criteria.

Re: How to make a search form for multiple values

Posted: Sat Oct 17, 2009 12:06 am
by Weiry
Should be rather simple, take the input you want from a form, submit to a search page which performs an SQL query with a lot of statements in your WHERE clause.

Code: Select all

SELECT * FROM `users` WHERE `gender` = 'Male' AND `city` = 'MyTown` AND `age` < '55' AND `age` > '23'  ...etc
Something along those lines at least.