PHP website help? It it possible?

derrick dobbs

New member
Aight i'm making a website in PHP, it's going to be basically a blog. The thing is i got the layout and such built already, now all i need is content YAY. But I'm wondering something...

The website has 5 pages ( and sub pages but right now those arn't a concern ) The thing is I want to post new articles daily on my main page, i don't want any more than 10 at a time on the main page. What i would like to do is write an article and post it, and the article then automatically sorts by Date ( earliest first ) on the "home" page if there are already 10 articles, and i post an 11th i want the new article to be number 1 and the old 10th article to be number one on page 2... I would like to be able to do this automatically and not having to move the articles around by hand >.< as that would be a huge pain givin i have 5 pages that are like this..

I don't know the term so i can't research it, so i'm hoping you kind of understand what i'm talking about..

Home page has 10 articles when i post another article it is automatically put at the top of home page, the old 10th articles then moves down to be the first on the second page.. Kind of like a rolling effect based on date, and on the 5th page, the oldest article will no longer be on any pages, and instead would be accessiable through the archives page ( which i know how to do )

I'm thinking that maybe a database of some kind where i post the articles to? where each article has an ID then the server pulls the ID and posts the articles? Would that work for this..? Although the articles will have pictures and such, how do i add the pictures into the databases as well??
Although it may be easier, and thats definatly the case, I like doing things the hard way for the learning experience. I prefer not to take the short cuts or easy ways untill i know i can do it on my own. Consider it a personal goal.
 
The term you're looking for is pagination or paging. It's usually accomplished by using the LIMIT option with two parameters (the record limit and the offset) in your mySQL query.

Here's a example: http://www.tech-evangelist.com/2008/10/16/mysql-limit-paging/

But speaking professionally, this is something that's been done a million times. Great for a learning experience, but otherwise, it's much more practical to use something that already does it (if not a fully pre-made CMS, then a framework like CakePHP that has the pagination function built into it). :)
 
The term you're looking for is pagination or paging. It's usually accomplished by using the LIMIT option with two parameters (the record limit and the offset) in your mySQL query.

Here's a example: http://www.tech-evangelist.com/2008/10/16/mysql-limit-paging/

But speaking professionally, this is something that's been done a million times. Great for a learning experience, but otherwise, it's much more practical to use something that already does it (if not a fully pre-made CMS, then a framework like CakePHP that has the pagination function built into it). :)
 
someone else mentioned Wordpress, I would concur, that there is no need to reinvent the wheel when a michelin tire already exists and is free to boot.
You could waste 100 or more hours of trying to deploy something that wordpress can have you doing in a 1/2 hour.
 
.....


Why are you trying to recreate the wheel? It's much easier to get Wordpress and make a new theme for it rather than make a theme and build a blog around it.
 
Back
Top