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.
<!--- Name: insert2.cfm Author: Ben Forta (firstname.lastname@example.org) Description: Table row insertion demo Created: 07/01/07 ---> <!--- Insert ...