webref.eu Posted September 15, 2009 Share Posted September 15, 2009 Hi All I want to show only the five most recent products added to a database. So far, I have the below query, how do I modify it to show only the first five most recent? $sql = "SELECT * FROM Products ORDER BY ProductDateAdded DESC"; Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/174373-solved-modify-query-to-show-five-most-recent-products/ Share on other sites More sharing options...
MadTechie Posted September 15, 2009 Share Posted September 15, 2009 add limit to 5 $sql = "SELECT * FROM Products ORDER BY ProductDateAdded DESC LIMIT 0,5"; Quote Link to comment https://forums.phpfreaks.com/topic/174373-solved-modify-query-to-show-five-most-recent-products/#findComment-919184 Share on other sites More sharing options...
webref.eu Posted September 16, 2009 Author Share Posted September 16, 2009 Great, thanks very much for that. Rgds Quote Link to comment https://forums.phpfreaks.com/topic/174373-solved-modify-query-to-show-five-most-recent-products/#findComment-919402 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.