News system question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aspekt9
Forum Commoner
Posts: 43
Joined: Wed Dec 06, 2006 5:03 pm

News system question

Post by aspekt9 »

Ok, here's what I'm trying to do. I'm working on a news system and I basically have three functions: displaynews(), addnews(), and managenews(). Is what I'm trying to do is make it so when a user clicks on an article they want to update it will populate the form with the data from the database and then if they change anything, update that row in the database. The problem is that I have display news show all the articles, their titles,id,and content and an edit button that redirects them to events.php?addnews and it populates the form correctly with everything from the database. The thing is that I use addnews to add a brand new article creation page. Now would I have to have two functions one to update and one to add news or can I use something like ON DUPLICATE KEY UPDATE?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

How about a fourth function: editnews()?
Post Reply