wmguk Posted September 6, 2008 Share Posted September 6, 2008 hey guys, im simply trying to limit the result returned from the database to the newest 3 records... $sql = "SELECT * FROM news ORDER BY pdate DESC LIMIT 3"; currently there are 6 records, and I want, 4, 5, 6 to be shown, however for some odd reason, at the moment it is showing 3, 4, 5 - and not the newest one... any ideas what I did wrong? Link to comment https://forums.phpfreaks.com/topic/123010-solved-odd-limit-problem/ Share on other sites More sharing options...
wmguk Posted September 6, 2008 Author Share Posted September 6, 2008 oh - I did try $sql = "SELECT * FROM news LIMIT 3"; too but that only shows the first 3 results, not the last Link to comment https://forums.phpfreaks.com/topic/123010-solved-odd-limit-problem/#findComment-635178 Share on other sites More sharing options...
wmguk Posted September 6, 2008 Author Share Posted September 6, 2008 ugh, its ok, its because all the dates are the same - ive set it to order by refnum and its now working! Link to comment https://forums.phpfreaks.com/topic/123010-solved-odd-limit-problem/#findComment-635180 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.