Hi All
I'm just trying to finalise something - am up to the last thing.
I have created a form which a user can submit so as to send an email to
someone. Also I am saving the data entered to the database.
I have on the page an area where a user can upload up to 3 pictures.
Photo 1
Photo 2
Photo 3
It all seems to be working fine but when I go to submit to the database I am
getting an error - if I have the column names for the photos etc in the
query to add the record to the database then nothing is getting saved.
I have the following code - (note I am aware that the lines are currently
commented out.
The first part of the code uploads the file - and this is being done OK.
The code below adds the record to the DB - except at present it isnt doing
this properly if I try to add data to the field name for the photos.
<cfif form.attachment_1 neq "">
<!--- first upload the file --->
<cffile action = "upload" filefield = "attachment_1" destination
= "c:\uploads\" nameconflict = "makeunique">
<cfset attachment_local_file_1 = "c:\uploads\#file.ServerFile#">
</cfif>
INSERT INTO tbl_virtualconsultation(
vcid,
title,
name,
age,
gender,
email,
phone,
enquiry,
desiredresults,
timeframe,
motivation,
previouscs,
proceduredetail,
replymethod,
<!---
photo1,
photo2,
photo3,
--->
agree2tncs,
daterecd)
Values ('#ThisVCID#',
'#Trim(FORM.title)#',
'#Trim(FORM.name)#',
#FORM.age#,
'#Trim(FORM.gender)#',
'#Trim(FORM.email)#',
'#Trim(FORM.phone)#',
'#Trim(FORM.enquiry)#',
'#Trim(FORM.results)#',
'#Trim(FORM.timeframe)#',
'#Trim(FORM.motivation)#',
#Form.previouscs#,
'#Trim(FORM.proceduredetail)#',
#Form.replymethod#,
<!---
'#Trim(FORM.attachment_1)#',
'#Trim(FORM.attachment_2)#',
'#Trim(FORM.attachment_3)#',
--->
#FORM.agree2tncs#,
#CreateODBCDate(now())#)
</cfquery>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262703
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4