Hello Friends,I have 1 query I want to search database with php code.I want to sort out results by columns. Like if I select category : Personal & Price: 25$ then it should sort out through this. Help ME Thanks!
you do it using the "order by" keyword in the select query that you have. at the end of your query add the code as shown below. select * from table_name order by category, price if you wish to make price as your primary sorting column and category as secondary sorting column then select * from table_name order by price, category the above statements with sort in ascending order. if you want the sort in descending order you can do it as follows select * from table_name order by price desc, category desc the keyword "desc" sorts the result in descending order. If "desc" is not used or if "asc" is used it will sort in ascending order.