DBI sql question
Jun 09, 2004 14:46 PDT
ok...sorry if this sounds vague, i probably don't know
exactly how to ask this question.
i am building a cgi that will allow people to hit the
site, and search a sql database based on various drop
down boxes. lets say for example i have 6 drop downs.
is there an elegant way to search (using DBI and
mysql) as opposed to what i consider an unelegant
take the first drop down, build a query on it if there
are no other drop down parameters. if there are,
build a query based on the first and second. if there
is a third, build a query with all three....and on.
example (my actual problem)
i am building a search for houses. first drop down is
for price range, second for bedrooms, thrid for baths,
fouth for special feature, fifth for keyword. there
must be a better way for me to build the sql queries
1. if price range and no others, then sql query is
2. if price range and one other, sql query is this.
3. if price range and two others, sql query is this.
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.