REcord Update form


A web application can contain a page that lets users edit their customer record.

An update page consists of two building blocks: An HTML form that lets users edit her or his data, and an Update Record server behavior (DW's term for PHP code) that updates the database.

You can add these building blocks in a single operation using the Record Update Form wizard.

Example: welcome-new-cust.php

To create an account, a user runs createAcct.php, enters data into a form and then clicks the Create My Account button. The application adds a new record to the Customer table and then opens a "thanks for signing up" page. This page could display the newly entered record for the customer to verify and change if necessary. In DW, this is called a Record Update Form.

To build a Record Update Form, you must A) retrieve the record to update by creating a recordset for the page; and, B) add a Record Update Form to the page.

  1. Create the recordset. The record you need to retrieve is the LAST record added to the Customer table.

    A MySQL query that does this is:

    MySQL
    SELECT *
    FROM Customer
    WHERE custID = (Select MAX(custID) from Customer)

    Use the Advanced... button in the recordset dialog to enter the query.

  2. Add the Record Update Form, select Insert > Data Objects > Update Record > Record Update Form Wizard, and fill in the dialog.

    The dialog has an After updating, go to field. Use your site's home page for this.


  3. Test the web application and verify that the record was inserted.

    You can verify that the new record was inserted by running the MySQL Query Browser, and querying your Customer table.

  4. Integrate this page into your site: Modify the page design and layout. Add your site navigation, personalization, and CSS styles to welcome-new-cust.php.