Hello can anyone point me in the right direction here. What is the best way to select results from a tabel but show them in a certain way, see below for preferred sorting.
10, 9, 8, 6, 5, 4, 3, 2, 1
make that into
6, 7, 8, 9, 10
and show in that order?
I have this so far…
$result = mysql_query("SELECT * FROM Chat ORDER BY Time DESC LIMIT 5");
Assuming that the numbers are not only 1-10, wrap it in a subquery and reorder back again.
SQLFiddle Demo