fankoff 0 Newbie Poster

Hallo guys,

a theoretical question I have there for you.
I have a search form in HTML with several input fields, so the user can search for particular features in a db.

My queiston: How can I generate a dynamic query, depending on which fields the user had filled in?

It should look like this:

>look at the input fields:
>if request.getParameter("art) !=null : Query + age
>if request.getParameter("experience") !=0 : + Query + experience
>if request.getParameter("instrument") != null: Query + instrument
> .... and so on

>final query = SELECT art, experience,instrument FROM x, y, z WHERE x.art = art AND y.experience experience AND z.instrument LIKE '%instrumen%' ;

I hope I have explained it somewhat understandable.

Any help is deeply appreciated! Thank you in advance...
fankoff

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.