I advise you to use jqgrid, it has an editable table that loads data either using XML or JSON
Check out their website http://www.trirand.com/blog/
and here is a demo where you can find how it connects to DB and how you can manipulate or edit your data: http://www.trirand.com/blog/jqgrid/jqgrid.html
Please tell me if its useful for you!