phppup Posted February 22, 2012 Share Posted February 22, 2012 My form has 40 fields, and I want to re-generate it to be reviewed as it was when submitted. Next, I want to be able to UPDATE the forms values, where necessary. Is there an easy way to UPDATE the entire form from the reviewable version. Is it smarter to update ONLY the specific items that need modification? Any examples would be helpful. Quote Link to comment https://forums.phpfreaks.com/topic/257546-update-record/ Share on other sites More sharing options...
Pikachu2000 Posted February 22, 2012 Share Posted February 22, 2012 If you try to UPDATE a field with the same value that's in it already, MySQL will ignore it anyhow. If you set a column to the value it currently has, MySQL notices this and does not update it. Quote Link to comment https://forums.phpfreaks.com/topic/257546-update-record/#findComment-1320072 Share on other sites More sharing options...
phppup Posted February 22, 2012 Author Share Posted February 22, 2012 YES, i read that. But is there a method that's considered BEST from a structure or behavioral standpoint? Quote Link to comment https://forums.phpfreaks.com/topic/257546-update-record/#findComment-1320077 Share on other sites More sharing options...
Pikachu2000 Posted February 22, 2012 Share Posted February 22, 2012 If you're presenting a form to a user to edit, then you update the database fields that correspond to the form fields. If the data for a field is different, the record will change, if not, it won't. Quote Link to comment https://forums.phpfreaks.com/topic/257546-update-record/#findComment-1320080 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.