Welcome Guest!
 Previous Message All Messages Next Message 
DBI sql question  matt boex
 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
than ....

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.

and on.


Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
 Previous Message All Messages Next Message 
  Check It Out!

  Topica Channels
 Best of Topica
 Art & Design
 Books, Movies & TV
 Food & Drink
 Health & Fitness
 News & Information
 Personal Finance
 Personal Technology
 Small Business
 Travel & Leisure
 Women & Family

  Start Your Own List!
Email lists are great for debating issues or publishing your views.
Start a List Today!

© 2001 Topica Inc. TFMB
Concerned about privacy? Topica is TrustE certified.
See our Privacy Policy.