dafallenangel Posted December 11, 2008 Share Posted December 11, 2008 Greetings Mates, I might butcher this but yeah lol.. not sure what to say on subject either. I am greating ready to do a News Script and im going to have it display 10 news post's for each page and was wondering If its possible to make a script that once it gets 10 pages it either archives the old news posts or puts them into another table and creates a link called Old News? at the bottom of the page it will show page numbers like Previous | 1 2 3 4 5 6 7 8 | Next can someone tell me if this is possible and maybe help me out in the right direction please Thank you DaFallenAngel Quote Link to comment Share on other sites More sharing options...
Mchl Posted December 11, 2008 Share Posted December 11, 2008 I hereby point you into direction of Basic Pagination Tutorial Quote Link to comment Share on other sites More sharing options...
dafallenangel Posted December 12, 2008 Author Share Posted December 12, 2008 Thanx for the tutorial but thats not what i wanted lol. i know how to make different pages up and stuff.. but what i want is a code or tutorial or something that when say like i have 10 pages of News that when new news is added the old post if it goes onto page 11 it will get transfered to a different table in database? sorry its been a long week for me lol.. basically i don't want the news to go over 10 pages of 10 posts on each.. can this be done? Quote Link to comment Share on other sites More sharing options...
xtopolis Posted December 12, 2008 Share Posted December 12, 2008 What is the point of transferring it to another database? Why not just limit your pagination display to 100 posts, of 10 per page? You could easily make a link/page that says "view archives" that will show post #101->onward... Is there a reason you want to "archive" them, or are you rather just looking for a way to "not show them unless asked" ? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted December 12, 2008 Share Posted December 12, 2008 Thanx for the tutorial but thats not what i wanted lol. i know how to make different pages up and stuff.. but what i want is a code or tutorial or something that when say like i have 10 pages of News that when new news is added the old post if it goes onto page 11 it will get transfered to a different table in database? sorry its been a long week for me lol.. basically i don't want the news to go over 10 pages of 10 posts on each.. can this be done? If you actually bothered to read the link he gave you, you'd immediately realize that the tutorial does exactly what you're asking for. Quote Link to comment Share on other sites More sharing options...
dafallenangel Posted December 12, 2008 Author Share Posted December 12, 2008 Well i don't want to have 100 news on one page and I don't have a real good reason why to show it like that its just way i want it. lol.. And DarkWater I did read through it and I didn't see anything about what i wanted i seen that they done like something like pages like <... 8 9 10 11 ...> and stuff but thats not what i wanted.. I don't want to transfer it to a new database i want it on the same one just on a different table the reason for it being on the different table is so incase I have to go into the database for something in the news section to add something new or something I don't wanna edit million and one posts so it fits right.. all i would have to edit would be 100 posts which would be simple. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted December 12, 2008 Share Posted December 12, 2008 Well i don't want to have 100 news on one page and I don't have a real good reason why to show it like that its just way i want it. lol.. And DarkWater I did read through it and I didn't see anything about what i wanted i seen that they done like something like pages like <... 8 9 10 11 ...> and stuff but thats not what i wanted.. I don't want to transfer it to a new database i want it on the same one just on a different table the reason for it being on the different table is so incase I have to go into the database for something in the news section to add something new or something I don't wanna edit million and one posts so it fits right.. all i would have to edit would be 100 posts which would be simple. Then clearly you didn't read it carefully enough. It completely shows you how to do what you wanted. Quote Link to comment Share on other sites More sharing options...
xtopolis Posted December 12, 2008 Share Posted December 12, 2008 I don't wanna edit million and one posts so it fits right.. all i would have to edit would be 100 posts which would be simple. I think you're doing something wrong... perhaps some database re-design is in order? Quote Link to comment Share on other sites More sharing options...
dafallenangel Posted December 12, 2008 Author Share Posted December 12, 2008 Well i don't want to have 100 news on one page and I don't have a real good reason why to show it like that its just way i want it. lol.. And DarkWater I did read through it and I didn't see anything about what i wanted i seen that they done like something like pages like <... 8 9 10 11 ...> and stuff but thats not what i wanted.. I don't want to transfer it to a new database i want it on the same one just on a different table the reason for it being on the different table is so incase I have to go into the database for something in the news section to add something new or something I don't wanna edit million and one posts so it fits right.. all i would have to edit would be 100 posts which would be simple. Then clearly you didn't read it carefully enough. It completely shows you how to do what you wanted. You must be seeing a page im not I am looking throught the 12 pages and all im reading about is Putting page numbers down as like << < 5 6 7 [8] 9 10 11 > >> This is not what im wanting to do... I already have my numbering pages done... and if you are talking about limits to 10 for each page i have that done as well i already knew that but thats not what i want.. Quote Link to comment Share on other sites More sharing options...
dafallenangel Posted December 12, 2008 Author Share Posted December 12, 2008 As i couldn't edit the other post.. I'm going try making this alittle simpler so you understand what i'm wanting to do.. As i stated before I have a News script that will allow 10 news postings on each page and shows all the page numbers at the bottom and stuff like that.. Now what i want to do is when say 10 pages of news is filled up the old posts say post 1 from lets say May 05, 2008 would be put on 11th page well it will pull out that post and post it into a new table on the same database and delete it from the old one. or i guess i could go with making the insert script to post in both and once it hits 11th page it deletes that one? maybe that would be a easier way to go about doing what i want? or create a cron job script that will run every 12 to 24 hours that will check to see if the pages exceed 10 pages Quote Link to comment Share on other sites More sharing options...
haku Posted December 12, 2008 Share Posted December 12, 2008 * Upon insert, do a count of the records. * If there are 101, then select the first post, ordered by date ascending, and get all the data out of it * Insert the data from that row into a different table * Go back to the first table and delete that row. Quote Link to comment Share on other sites More sharing options...
dafallenangel Posted December 12, 2008 Author Share Posted December 12, 2008 Thank you Finally someone with knowlege haha.. That will help me I hope.. Quote Link to comment Share on other sites More sharing options...
Mchl Posted December 12, 2008 Share Posted December 12, 2008 Thank you Finally someone with knowlege haha.. That will help me I hope.. Except that's pointless... Why not just select 100 first posts for your 10 pages... Quote Link to comment Share on other sites More sharing options...
haku Posted December 12, 2008 Share Posted December 12, 2008 I agree to some degree. But as the database gets bigger, getting those hundred posts will take longer and longer. This could keep the main table a little more streamlined. Quote Link to comment Share on other sites More sharing options...
Mchl Posted December 12, 2008 Share Posted December 12, 2008 That is a valid point to some degree (that's why partitioning has been introduced), but it would have to be rally large table to make a noticeable difference... 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.