View Full Version : Display entire table and edit?

11-23-2006, 09:32 PM
Is it possible with php to write a page to display and entire table into text boxes that will allow the user to edit the values in the text boxes and then click a single button to overwrite any changes? Currently I have the users using a formatted excel spreadsheet to modify the table entries but I would like to php it.

I was going to use something like this, but I would prefer to be able to edit the table inline with the display rather than having the user have to select the line entry and edit it in a second page.


11-24-2006, 10:24 AM
of course that is possible. i don't really see what the problem could be...
i 'm not exactly sure what info you're expecting from us, but i've written pages that do such updates (only updating changed records) so i definitely know it's possible, and not even that hard to do.

you just need to make sure that the formfields are elements of a 3d array where the 2d elemenetskey = the PK from the table and the 3d elementskey is the columnname.
you then store the 'old' values in a sessionarray with the same structure, and when you run through the post-collection, you compare the posted values with the corresponsing element from the sessionarray. if they are changed, you update the record.

it get's slightly more complicated if you don't want to reveal your tablestructure through the formfields, but it's still not that hard.

i could write it for you in under an hour, and it would cost you $100.