lilwing Posted August 14, 2007 Share Posted August 14, 2007 hey guys, okay i will give the situation before i ask my question: i am archiving data in mysql, each has an id number from smallest (oldest) to largest (newest), by the week. on my website, i would like to display only the newest week and the week before it. (or the weeks with the largest ids). how can i do that? Quote Link to comment https://forums.phpfreaks.com/topic/64865-solved-displaying-mysql-on-web-page-question/ Share on other sites More sharing options...
lemmin Posted August 14, 2007 Share Posted August 14, 2007 "SELECT * FROM table ORDER BY id DESC LIMIT 14" That would get the first 14 (two weeks) entries with the highest id numbers. Quote Link to comment https://forums.phpfreaks.com/topic/64865-solved-displaying-mysql-on-web-page-question/#findComment-323658 Share on other sites More sharing options...
lilwing Posted August 14, 2007 Author Share Posted August 14, 2007 thanks Quote Link to comment https://forums.phpfreaks.com/topic/64865-solved-displaying-mysql-on-web-page-question/#findComment-323661 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.