How to list products that have the lowest price for the largest!
From lowest to highest! Using PHP and Mysql.
How to list products that have the lowest price for the largest!
From lowest to highest! Using PHP and Mysql.
Just add this code to the end of your select
:
ORDER BY 'preco' Asc
In this case, you use ASC
to sort ascending and DESC
to sort descendingly.
A% complete% would look like this:
SELECT * FROM 'produtos' ORDER BY 'preco' Asc
You can see an example using select
in this link.
Here's an example in SqlFiddle: Example here