News system question
Moderator: General Moderators
News system question
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?