/    Sign up×
Community /Pin to ProfileBookmark

Is it possible to fully automate my page?

I would like to know if I am able to set up a MySQL database for my news page and only have to update one field, so that I can have four fields, and when the first one is updated all the data gets moved down one.

Here’s an example. Say I have a field called LNews(Latest News) and three called PNews, PNews1 etc to PNews3. Lets say that I currently have text in LNews, but now I have a newer article which will replace this one, I would like to put this new text into LNews, and then have the text that is currently in LNews put into PNews1, and so on, so that the text that is in PNews3 will be replaced with PNews2, and all I have to do is update LNews and the rest will be taken care of.

Is this possible?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@aj_nscApr 10.2007 — If you are planning on doing this with a database, then that is bad design. Why not think of it this way: Add all your news entries to a table in a database which has fields like (newsid, date, and text) and then just select the 4 newest ones (order by date) and display these entries?
Copy linkTweet thisAlerts:
@DARTHTAMPONApr 10.2007 — get lnews,pnews1,pnews2

update news set lnews = $newnews, pnews1 = $lnews, pnews2 = $pnews1, pnews3 = $pnews2 where newsid = $newsid

will do the trick but I am in favor of what the above poster stated. That way you have a record of all the news and you will not lose data that someday you may want to access again.
Copy linkTweet thisAlerts:
@ShaunBurdenauthorApr 11.2007 — I don't think I worded my question correctly. I don't want to have full news articles at this point, this is just for my news home page, where there will be links to the full articles. When I said I would like LNews etc, I mean that these would be the first few lines of the article with a link to the full article.

Would what I am asking be fine for this?
×

Success!

Help @ShaunBurden spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...