⇧
vadnica-logo
My Services About the Project Telegram O meni O meni

Sorting Data (ORDER BY)

The ORDER BY clause is used to sort results by one or more columns. By default, it sorts in ascending order (ASC), but we can also use descending order (DESC).

EXAMPLE
RESULT
The result will be displayed here...

In PDO, we execute this with a simple query() statement and then output the sorted data using a loop. This is extremely useful when displaying lists of users or products.