starkplastic Posted December 11, 2007 Share Posted December 11, 2007 Hi, I'm trying to figure out how to logically display the latest posts except for the latest post. I.e. displaying the top five posts excluding the latest one. Can anybody help me with this code or do you have a better solution? $query = "SELECT id, date, title, post FROM news_posts WHERE ID!=$topid ORDER by date DESC limit 5"; $topid = mysql_query("SELECT id FROM news_posts ORDER by date DESC 1"); cheers Quote Link to comment https://forums.phpfreaks.com/topic/81234-solved-displaying-posts-ignoring-the-latest/ Share on other sites More sharing options...
fenway Posted December 12, 2007 Share Posted December 12, 2007 Why don't you use an offset... e.g. LIMIT 1, 5? Quote Link to comment https://forums.phpfreaks.com/topic/81234-solved-displaying-posts-ignoring-the-latest/#findComment-412949 Share on other sites More sharing options...
starkplastic Posted December 12, 2007 Author Share Posted December 12, 2007 thanks, what an easy and great solution !!! Quote Link to comment https://forums.phpfreaks.com/topic/81234-solved-displaying-posts-ignoring-the-latest/#findComment-412979 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.