Greetings,
I am writing a very simple script that pulls a resultset out of a database.
These rows are then made into form variables where the user has the option
to update multiple entries, hit submit and the system updates the
appropriate fields. I am using the convention of "variable[rowid]" in the
input form, it allows me to loop through all the results and update the
database.
This solution is working fine, but I hate the idea that I'm updating data
that isn't changing. I've considered keeping state when a form is shown,
then comparing the values between the original state, and if its different
then update the database.
I hate to re-invent the wheel, how is this handled in other applications?
I've tried to divine it out of some other programs, but I'm having trouble
finding an application that is doing something like what I am doing.
Any guidance here is appreciated.
--Brian
I am writing a very simple script that pulls a resultset out of a database.
These rows are then made into form variables where the user has the option
to update multiple entries, hit submit and the system updates the
appropriate fields. I am using the convention of "variable[rowid]" in the
input form, it allows me to loop through all the results and update the
database.
This solution is working fine, but I hate the idea that I'm updating data
that isn't changing. I've considered keeping state when a form is shown,
then comparing the values between the original state, and if its different
then update the database.
I hate to re-invent the wheel, how is this handled in other applications?
I've tried to divine it out of some other programs, but I'm having trouble
finding an application that is doing something like what I am doing.
Any guidance here is appreciated.
--Brian
Comment