This example illustrates how to execute query with ORDER BY clause in the php application.
In this example we create a php page to execute a query for select data of the table as order by name in decreasing order. SQL allows for sorting of retrieved data with the ORDER BY clause. This clause requires the column name based on which the data will be sorted. The ORDER BY clause can sort in an ASCENDING (ASC) or DESCENDING (DESC) order depending upon the argument supplied. The Complete source code and output screen shots as follows:
Source Code of sqlorderby.php