getting data from database according to the user selection


i am new to php.

I am trying to do a search. but not getting how exactly i can achieve this.

Here is my html form

Select a color

Red Blue White

Select cloth

Silk Cotton

Select brand

Levis Ethnica Biba

Select type

Shirt Skirt Salwar Kurtis [/code]

Here i want to display the result from database according to the selection.

if nothing is selected, then i will display all the data.
if only color and brand or only color selected, or brand selected it should display only that.

I am not getting which condition to use.

if i use if- else condition, then my code become repetitive and too lengthy. If i use switch, again i have to use if-else inside it.

please somebody help me. I really need your help

Please describe which database you are using?

Sponsor our Newsletter | Privacy Policy | Terms of Service