Creating the Update Page

After the administrator makes changes to call details via the form admin_edit.cfm, she'll hit the "submit" button, which will post the edited data to the ACTION page we'll now create, update.cfm.

To create this page, you'll use ColdFusion's <CFUPDATE> tag. <CFUPDATE> requires that one of the fields you post to it be the table's primary key, in this case, the ID field. It searches the table for the record matching the specified ID and updates the other fields using the text you supply.

In every other sense, <CFUPDATE> is identical to <CFINSERT>, so we'll cut-and-paste the code from the page cfinsert.cfm. It appears, slightly modified, in Figure 7.14.

Figure 7.14. The ACTION page update.cfm.

Other than a few changes to ...

Get Sams Teach Yourself ColdFusion® in 21 Days 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.