O'Reilly logo

Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started by Charlie Arehart, Raymond Camden, Ben Forta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Processing Additions

The next thing you need is a template to process the actual data insertion—the ACTION page mentioned earlier. In this page use the SQL INSERT statement to add the new row to the Films table.

See Chapter 7, “SQL Data Manipulation,” for an explanation of the INSERT statement.

As shown in Listing 14.4, the <cfquery> tag can be used to pass any SQL statement—not just SELECT statements. The SQL statement here is INSERT, which adds a row to the Films table and sets the values in seven columns to the form values passed by the browser.

Listing 14.4. insert2.cfm—Adding Data with the SQL INSERT Statement
<!--- Name: insert2.cfm Author: Ben Forta (ben@forta.com) Description: Table row insertion demo Created: 07/01/07 ---> <!--- Insert ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required