BR
asked on
Selecting all data from the related category
Dear Experts,
I use php and mysql database
I have a drop down list where my user filter my category to see the related items.
My sql sentence is like
Select * from catagory_table where catagory='$category' order by id
I want to add to my drop down list an "all" option.
How can i write an sql to bring all the data from category table if my user selects "all" as an option.
Do i need another a coloumn in the database? Or should i use and if statement for sql statement like:
If the user selects "all" as an option, use this sql sentence otherwise use this sql sentence?
I use php and mysql database
I have a drop down list where my user filter my category to see the related items.
My sql sentence is like
Select * from catagory_table where catagory='$category' order by id
I want to add to my drop down list an "all" option.
How can i write an sql to bring all the data from category table if my user selects "all" as an option.
Do i need another a coloumn in the database? Or should i use and if statement for sql statement like:
If the user selects "all" as an option, use this sql sentence otherwise use this sql sentence?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER