Basic SQL insert statement is: |
INSERT INTO tablename (columnnames) VALUES (values) |
The VALUES keyword specifies the values for the columns in the new row. You have to type the values you want to add in the same order as the columns in the columnnames section of the statement. |
To insert the form data from the example above with a CFQUERY use this syntax: |
<CFQUERY NAME="AddEmp" DATASOURCE="CF 3.0 Examples"> |
INSERT INTO Employees (FirstName, LastName, Phone) |
VALUES ('#Form.FirstName#', '#Form.LastName#', |
'#Form.Phone#') |
</CFQUERY> |