ColdFusion is very efficient at adding and updating data, but not at deleting it. DELETE is always a dangerous operation, and the ColdFusion developers didn’t want to make it too easy to delete data by mistake.
To delete data in a ColdFusion template, you must use the SQL DELETE statement, as shown in Listing 14.12. The code first checks to ensure that a FilmID was passed; if the URL.FilmID field isn’t present, the statement terminates. If a FilmID is passed, a <cfquery> is used to pass a SQL DELETE statement to the data source.
|→||See Chapter 6 for an explanation of the DELETE statement.|
<!--- Name: delete1.cfm Author: Ben Forta (email@example.com) Description: ...