I draw a do while
news to the page by id
, but when adding a new news, it appears at the very bottom. How to start a loop in reverse order?
Here is the code:
do { if(!$myrow['img']){ printf (" <div class='news_content'> <a href='/news?id=%d'><img src='images_site/no-image.png'/></a> <div class='news_main'> <p class='time_comment'>%s</p> <a href='/news?id=%d'><h4 class='time_comment'>%s</h4></a> <p class='time_comment_p'>%s</p> <a class='readon' href='/news?id=%d'>Читать продолжение</a> </div> </div>", $myrow['id'], $myrow['date'], $myrow['id'], $myrow['title'], $result, $myrow['id']); } else { printf (" <div class='news_content'> <a href='/news?id=%d'><img src='%s'/></a> <div class='news_main'> <p class='time_comment'>%s</p> <a href='/news?id=%d'><h4 class='time_comment'>%s</h4></a> <p class='time_comment_p'>%s</p> <a class='readon' href='/news?id=%d'>Читать продолжение</a> </div> </div>", $myrow['id'], $myrow['img'], $myrow['date'], $myrow['id'], $myrow['title'], $result, $myrow['id']); } } while ($myrow = mysql_fetch_array($resylt));`
ORDER BY
in the request so that the data$resylt
into$resylt
in the order you$resylt
- cyadvert