O'Reilly logo

ColdFusion 9 Developer Tutorial by John Farrar

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

Saving our data

Now if we could save our data, that would be great. We will be using the same database that we used in the last chapter. We can see this book's site at http://books.sosensible.com if we need to set up this database for practice. Let us look at the two ways in which a record is saved in ColdFusion. The first is how we would save a new record. This is called an INSERT query:

<cfquery datasource="cfb" name="qryInsert">
INSERT INTO product( name , description , price)VALUES(
<cfqueryparam value="#form.name#"> ,
<cfqueryparam value="#form.description#"> ,
<cfqueryparam value="#form.price#">)

</cfquery>

Here, we see the basic code structure of an INSERT query. We can see that the one thing different from the standard queries here is ...

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