php - Saving Data: Check if value has changed? -
lets form has bunch of fields, , 1 or 2 of them changed , need saved. you:
- just update database values, regardless if have changed.
- use form states, , post values have changed.
- check new value against old value, externally class.
- check new value against old value, internally, in
set_property()
method. - 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
Post a Comment