arakay Posted September 1, 2003 Share Posted September 1, 2003 I\'m making an automated link directory to kinda teach myself php and mySQL. I want to make a \"newest five links\" thing on the main page. I know how to select the information from the table, etc, and that I should include ORDER BY id DESC so that the entry with the highest number will appear first. I just can\'t figure out how to make it stop after 5. Help for the newbie? *hopeful look* Quote Link to comment Share on other sites More sharing options...
akitchin Posted September 1, 2003 Share Posted September 1, 2003 you could add the LIMIT 5 clause. i think this limits the results to 5 rows. Quote Link to comment Share on other sites More sharing options...
Dissonance Posted September 1, 2003 Share Posted September 1, 2003 \"SELECT * from LINKS ORDER BY id DESC LIMIT 5,0\" That should do it. Quote Link to comment Share on other sites More sharing options...
arakay Posted September 2, 2003 Author Share Posted September 2, 2003 Thanks! That made it work! *grin* Quote Link to comment 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.