It is necessary to add the last three lines to the array from the database table, how can this be done?
include('connections/trooble.php'); $q = mysql_query("SELECT * FROM test ORDER BY (`id`) DESC LIMIT 3"); $r = mysql_fetch_array($q); while ($r = mysql_fetch_array($q)) { $n[] = $r['news']; } $i = 0; while ($i < 3) { $a = $n[$i]; $i++; echo $a; }
It seems everything is correct, but does not display the very first news.