php - Saving Data: Check if value has changed? -


lets form has bunch of fields, , 1 or 2 of them changed , need saved. you:

  1. just update database values, regardless if have changed.
  2. use form states, , post values have changed.
  3. check new value against old value, externally class.
  4. check new value against old value, internally, in set_property() method.
  5. then you'd have keep array of updated fields saved...

i might wrong, seems examples i've seen #1. if have large list of 100+ posts in 1 table, don't want loop through , save them every time update 1 field...

i'd use #2, keeping track of has changed since last saved.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -