|
Posted by Kenoli on 03/09/07 03:04
I am displaying a long list of records from a mysql database in a kind
of spreadsheet format with records making up the rows and fields the
columns. The reason for this is that users have a need to scroll
through a lot of records and edit a thing here or there in a text
field, checkbox, etc.
The way I have it set up is that when they are through, they perform a
submit and all records are updated. There are some problems with
this, including the fact that if someone gets to this page in a way
that no data is displayed and hits update, they could erase the whole
database.
Is there any way to update only the records that have been changed?
As this is kind of a client side thing, I'm suspecting that javascript
may be the tool here; I know that it would be possible using AJAX.
But I'm wondering if there is some way to only select the $_POST
elements that have been changed. I can think of some complicated ways
like storing the orignal data in session variables and comparing the
new POST data with the old session data, or having the user check a
box next to the changed records (they could easily miss a record and
lose changes) or check a set of records and move them to a new page
where they alone are updated (this is less convenient for the user).
I'm wondering if there is any simpler, more elegant way.
Any ideas?
Thanks,
--Kenoli
[Back to original message]
|