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 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"; 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 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
Archived
This topic is now archived and is closed to further replies.