sql - Reverse the array in php

Solution:

You can use ORDER BY clause of MySQL in your query.

select * from news ORDER BY id DESC

Answer

Solution:

Try using the ORDER BY clause in your query which will save you tons of time and effort. If you want the result to be in descending. Try the code below.

select * from news ORDER BY id DESC

or if you want the result to be in ascending.

select * from news ORDER BY id ASC

Source