shawntbanks
Programmer
I am having a problem trying to insert a variable into a record in a table.
<cfquery datasource="market">
insert into saleitem_tmp (subcategoryid, location, itemname, ShortDescription,
longDescription, itemprice, featured, begindate, enddate, picture1, picture2, picture3, picture4)
values(#arylocalcart[whichad].subcategoryid#, '#trim(arylocalcart[whichad].location)#', '#Trim(arylocalcart[whichad].itemname)#',
'#trim(arylocalcart[whichad].Short_Description)#', '#trim(arylocalcart[whichad].long_Description)#', '#trim(arylocalcart[whichad].itemprice)#',
'#trim(arylocalcart[whichad].featured)#', #arylocalcart[whichad].begindate#, #arylocalcart[whichad].enddate#,
'#trim(arylocalcart[whichad].picture1)#',
'#trim(arylocalcart[whichad].picture2)#',
'#trim(arylocalcart[whichad].picture3)#',
'#trim(arylocalcart[whichad].picture4)#')</cfquery>
the part which is red is the problem area. It is a text field originaly and some of the text some time will look like this
Living rm w/12' ceilings
PROBLEM (') this character. I get an error because of this.
Line 4: Incorrect syntax near 'ceilings'
Anybody got any ideas
<cfquery datasource="market">
insert into saleitem_tmp (subcategoryid, location, itemname, ShortDescription,
longDescription, itemprice, featured, begindate, enddate, picture1, picture2, picture3, picture4)
values(#arylocalcart[whichad].subcategoryid#, '#trim(arylocalcart[whichad].location)#', '#Trim(arylocalcart[whichad].itemname)#',
'#trim(arylocalcart[whichad].Short_Description)#', '#trim(arylocalcart[whichad].long_Description)#', '#trim(arylocalcart[whichad].itemprice)#',
'#trim(arylocalcart[whichad].featured)#', #arylocalcart[whichad].begindate#, #arylocalcart[whichad].enddate#,
'#trim(arylocalcart[whichad].picture1)#',
'#trim(arylocalcart[whichad].picture2)#',
'#trim(arylocalcart[whichad].picture3)#',
'#trim(arylocalcart[whichad].picture4)#')</cfquery>
the part which is red is the problem area. It is a text field originaly and some of the text some time will look like this
Living rm w/12' ceilings
PROBLEM (') this character. I get an error because of this.
Line 4: Incorrect syntax near 'ceilings'
Anybody got any ideas