lostprophetpunk Posted October 6, 2008 Share Posted October 6, 2008 I have used the following for the main page in my blogging system, but I would only like to show the latest 5 entries on the main page, rather than all of the entries as it is currently. while($Data = mysql_fetch_array($res)) { //data here } How would I limit it to just the latest 5 entries? Link to comment https://forums.phpfreaks.com/topic/127247-5-latest/ Share on other sites More sharing options...
F1Fan Posted October 6, 2008 Share Posted October 6, 2008 Do this in your SQL query. SELECT * FROM table ORDER BY column DESC LIMIT 5 Link to comment https://forums.phpfreaks.com/topic/127247-5-latest/#findComment-658152 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.