zehrila Posted June 11, 2011 Share Posted June 11, 2011 I have commenting system in place, which works just fine, however, it works in a way that new comments goes at the end of page, i was wondering if i could place some code, which computers which comment is latest and then show it on top of older comments? in short, i want latest comments to show up first. Any help? Quote Link to comment https://forums.phpfreaks.com/topic/239084-how-to-make-latest-comments-appear-first/ Share on other sites More sharing options...
fugix Posted June 11, 2011 Share Posted June 11, 2011 If you are using a database to store your comments, which I assume that you are, when querying them for display, you can order them by the unique key desc. Expample mysql_query("select * from comments order by id desc"); Quote Link to comment https://forums.phpfreaks.com/topic/239084-how-to-make-latest-comments-appear-first/#findComment-1228393 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.