I am trying to use cfhttp to create a query out of a text
file and then loop
and insert it into a database. Easy enough and works fine.
However, I am
getting a forward slash in some of the fields which is
causing an error.
'SOUTH OF SOUTH BLVD AND EAST OF BEACH RD\'
It is being entered into a LONGTEXT field in MySQL 5. Any way
to get the '\'
to be ignored and just be entered?
Here is my script block:
<cfhttp timeout="3600" url="
http://www.bpoprosonline.com/property/#ResFile#"
method="GET" name="Property" delimiter="|" textqualifier=""
firstrowasheaders="yes" />
<cfloop query="Property">
<cfquery name="loopProperty" datasource="bpopros">
Insert Into Property
(MLSNumber, ListOfficeCompany, ListOfficeId, Basement, Baths,
BFK_Dimen,
BR2_Dimen, BR3_Dimen, BR4_Dimen, BR5_Dimen, City, County,
Din_Dimen,
Directions, Directions_E_W, Directions_N_S, East_West,
Fam_Dimen, Fireplace,
Garage, Grt_Dimen, Kit_Dimen, Lib_Dimen, ListPrice,
Liv_Dimen, Lot_Dimen,
MBR_Dimen, No_Bedrooms, North_South, Remarks1, Remarks2,
Remarks3, Remarks4,
Remarks5, Remarks6, School_District, State, Street_Dir,
StreetName,
StreetNumber, SummerTax, Tot_Baths, Tot_Lavs,
Tot_Square_Feet, Winter_Tax,
Year_Built, Zip5, Appliances, Basement_Type, Bath_Desc,
Cooling, Exterior,
Foundation, Garage_Type, Heating, Other_Rooms, Site_Desc,
Style, PhotoURL,
DisplayAddress, Agent, weight)
VALUES
(
<cfif #MLSNumber# EQ
"">0<cfelse>#MLSNumber#</cfif>,
'#ListOfficeCompany#',
<cfif #ListOfficeId# EQ
"">0<cfelse>#ListOfficeId#</cfif>,
'#Basement#',
<cfif #Baths# EQ
"">0<cfelse>#Baths#</cfif>,
'#BFK_Dimen#',
'#BR2_Dimen#',
'#BR3_Dimen#',
'#BR4_Dimen#',
'#BR5_Dimen#',
'#City#',
'#County#',
'#Din_Dimen#',
'#Directions#',
'#Directions_E_W#',
'#Directions_N_S#',
'#East_West#',
'#Fam_Dimen#',
'#Fireplace#',
'#Garage#',
'#Grt_Dimen#',
'#Kit_Dimen#',
'#Lib_Dimen#',
<cfif #ListPrice# EQ
"">0<cfelse>#ListPrice#</cfif>,
'#Liv_Dimen#',
'#Lot_Dimen#',
'#MBR_Dimen#',
<cfif #No_Bedrooms# EQ
"">0<cfelse>#No_Bedrooms#</cfif>,
'#North_South#',
'#Remarks1#',
'#Remarks2#',
'#Remarks3#',
'#Remarks4#',
'#Remarks5#',
'#Remarks6#',
'#School_District#',
'#State#',
'#Street_Dir#',
'#StreetName#',
'#StreetNumber#',
'#SummerTax#',
<cfif #Tot_Baths# EQ
"">0<cfelse>#Tot_Baths#</cfif>,
<cfif #Tot_Lavs# EQ
"">0<cfelse>#Tot_Lavs#</cfif>,
<cfif #Tot_Square_Feet# EQ
"">0<cfelse>#Tot_Square_Feet#</cfif>,
'#Winter_Tax#',
<cfif #Year_Built# EQ
"">0<cfelse>#Year_Built#</cfif>,
<cfif #Zip5# EQ "">0<cfelse>#Zip5#</cfif>,
'#Appliances#',
'#Basement_Type#',
'#Bath_Desc#',
'#Cooling#',
'#Exterior#',
'#Foundation#',
'#Garage_Type#',
'#Heating#',
'#Other_Rooms#',
'#Site_Desc#',
'#Style#',
'#PhotoURL#',
'#DisplayAddress#',
0,
<cfif #ListOfficeId# EQ
340169>1<cfelse>0</cfif>)
</cfquery>
</cfloop>
Thanks
--
Wally Kolcz
MyNextPet.org
Founder / Developer
586.871.4126