sintax63 Posted January 30, 2008 Share Posted January 30, 2008 I have one table which contains user submitted entries. On the web page which is displaying the entries, I would like to have an "Update This Information" link which users could use to correct any invalid information which was previously submitted. I thought the best way to do this would be to capture the unique ID for that entry, and create an entry in a new table (called "updates") with the updated information. From that table I could approve the updated record and then replace the information in the main table. The problem is, I'm not really sure how to merge, or overwrite the record in the main table with that from the updates table. I will need to keep the same unique ID. Anyone care to shed some light on this subject? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/88565-updating-one-table-record-from-another-table/ Share on other sites More sharing options...
revraz Posted January 30, 2008 Share Posted January 30, 2008 use the UPDATE mysql function to update an existing row. Quote Link to comment https://forums.phpfreaks.com/topic/88565-updating-one-table-record-from-another-table/#findComment-453478 Share on other sites More sharing options...
sintax63 Posted January 30, 2008 Author Share Posted January 30, 2008 How I have it set up now is that on my "approval page", I pull the record from my 'updates' table and upon approval I use the UPDATE function on the 'main' table... since both are using the same unique ID. It works well, but I didn't know if this was sloppy and there was a better way to do it. Quote Link to comment https://forums.phpfreaks.com/topic/88565-updating-one-table-record-from-another-table/#findComment-453487 Share on other sites More sharing options...
revraz Posted January 30, 2008 Share Posted January 30, 2008 If that is your method and it works, then stick with it. Since you want to approve them first, sounds like you are doing it right. Quote Link to comment https://forums.phpfreaks.com/topic/88565-updating-one-table-record-from-another-table/#findComment-453494 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.