Skip to main content
Known Participant
October 17, 2011
Question

Updating records displayed in Dynamic Tables

  • October 17, 2011
  • 3 replies
  • 2569 views

I am currently building a web based system that handels orders. There are various pages that all use dynamic tables (repeat tables) to display different details about the orders and all pages use the same "orders" database. I have created a recordset on each page to display the data and everything works corrdectly. In the repeat table I added an "update" column and for each row there is an "update" button in that column. My goal is for the user to be able to edit the fields that are editable and click the button "update" and have it update the record in the database. I have used the update record function in dreamweaver and all works correctally when there is only one row dispalyed however when more than one row is displayed it does not update liek planned... The form is wrapped around the repead table. Any advice on how to fix this would be great. Thanks so much.

This topic has been closed for replies.

3 replies

Participating Frequently
October 17, 2011

AFAIK, DW does not handle multiple row updates. You will have to use a loop to update multiple rows. What scripting language are you using?

MurraySummers
Inspiring
October 17, 2011

DW can handle such a thing, but you would have to hack the code it writes.

Known Participant
October 18, 2011

For testing purposes, change this -

  $updateSQL = sprintf("UPDATE orders SET status=%s WHERE orderID=%s",

                       GetSQLValueString($_POST['status'], "text"),

                       GetSQLValueString($_POST['orderid'], "int"));

to this -

  $updateSQL = sprintf("UPDATE orders SET status=%s WHERE orderID=%s",

                       GetSQLValueString($_POST['status'], "text"),

                       GetSQLValueString($_POST['orderid'], "int"));

exit($updateSQL);

and let us know what you get when you select various rows to update.  Let's see what that SQL Update string looks like....


If I instead created a repeating div for each order to be displayed would that possibly make it so it recognizes which order to update?

MurraySummers
Inspiring
October 17, 2011

I guess we'd have to see your code to know why it's not working.

Known Participant
October 17, 2011

The only record that will update is the last record of the repeat table. All the records before when submitted dont do anything