home *** CD-ROM | disk | FTP | other *** search
- <!--- This INSERT statement does the actual adding
- of the data to the database; notice that the
- SQL statement contains Cold Fusion #variables# --->
- <CFQUERY DATASOURCE="CFexamples" NAME="InsertEmployee">
- INSERT INTO EmpEmployees
- (FirstName,
- LastName,
- Title,
- DepartmentID,
- Temporary,
- Email,
- <CFIF Form.StartDate NEQ "">StartDate,</CFIF>
- Phone)
- VALUES ('#Form.FirstName#',
- '#Form.LastName#',
- '#Form.Title#',
- #Val(Form.DepartmentID)#,
- <!--- "Temporary" was an input of type
- CHECKBOX, which is either TRUE or
- does not exist at all --->
- <CFIF IsDefined("Form.Temporary")>
- TRUE,
- <CFELSE>
- FALSE,
- </CFIF>
- '#Form.Email#',
- <CFIF Form.StartDate NEQ "">#CreateODBCDate(Form.StartDate)#,</CFIF>
- '#Form.Phone#')
- </CFQUERY>
-
- <!--- Go back to the Add Employee page --->
- <CFLOCATION URL="InsertForm.cfm">