> i am having problems getting this statement to write to the db
> properly.... all of the fields enter the way they should accept
> the ImageName which is a file upload..
> it shows up in the db as C:\windows\temp... ect...
> it worked a few days ago and i took one form field out of the
> statement and the form its self and now i cant get it to work
> again... so here is the code (both that i have tried to use in
> the last 2 hours)
> <!--
>
> <cfquery name="Image" datasource="????" dbtype="ODBC">
> INSERT INTO ImageManager (ImageName, BigImage, ArtistName, Year,
> Date, Type, RealName, Size, PriceFrame)
> VALUES (
> '#ImageName#',
> '#form.BigImage#',
> '#form.ArtistName#',
> '#form.Year#',
> '#form.Date#',
> '#form.RealName#',
> '#form.Size#',
> '#form.PriceFrame#')
> </cfquery>
> -->
> With this i get a syntax error on my INSERT INTO

9 fields listed in the field names, 8 in the values
Also, your year field may be numeric, and putting ' around it may cause it
to fail

> <cfset ImageName = Form.ImageName>
> <cfinsert datasource="????"
>    tablename="ImageManager"
>    dbtype="ODBC"
>    formfields="ImageName, BigImage, ArtistName, Year, Date, Type,
> RealName, Size, PriceFrame">
> -->
> with this everything goes fine accept it enters the
> C:\WINNT\TEMP\ACF2F19.tmp (or something like it) in the ImageName
> field of the db.
> has anyone else had this problem or can anyone PLEASE help me?
> (oh yeah the file uploads fine just enters the wrong info into the db.)

If form.ImageName an upload, then it will probably go wrong as you have to
upload the image first (using CFFILE)

Also, if you're storing the images in the database - DON'T!!!
It causes more hassle to bring the data into and out of the table than
storing them on the hard disk and just supplying the location - also, it
takes more hard disk space

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to