$result = sql_query("select artid, secid, title, content, counter
from ".$prefix."_seccont where secid=$secid $querylang ORDER BY artid DESC", $dbi);
Changing the order of results
This is a typical example of changing the order of results of a database selection. This was achieved by solely adding "ORDER BY artid DESC" to the SQL query string. In plain text, this means
"order the results by descending article id". The "right way" would of course be to sort by time. But lacking an extra timestamp field, we make use of the fact that later articles have a higher id.
Thus, sorting by descending id will give last articles first. Think of this simple trick whenever you seek a simple way to change the order of some results.