Updating Database Records

Maybe someone made an error while entering data into the database. Maybe the price of your product changes. Or maybe you want to provide a way for your Web visitors to update their email addresses. In any case, the time will come when you want to edit a record in a database.

Creating Update Record Forms in Dreamweaver is very similar to creating Insert Record forms. Both require a HTML form that your audience can fill out and submit. The primary difference is that an update form is already filled out with information from the database. It’s like a combination of an Insert Record Form and a record detail page (such as the one created by the Master Detail Page set described on page 663).

The first step in creating an update form is to add a recordset to the update page (see page 636). The recordset will retrieve the data that appears in each field of the update form.

The recordset should contain only a single record—the one to be updated. Therefore, you must use a form or URL parameter to filter the recordset (see page 639 for more on filtering). For example, on a page listing company employees, you could add an Edit button that would link to the page containing the update form. If you added a Go To Detail Page server behavior (see page 667) to the employee listing page, you could then pass the ID for a specific employee to the update page. In turn, the update page would use that ID to filter the database for a single record and display the employee information ...

Get Dreamweaver MX: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.