<cfquery datasource="files" name="f">
SELECT filename, desc
FROM [results.txt]
</cfquery>
<cfloop query="f">
<cfif len(trim(f.filename)) NEQ 0>
<cfquery datasource="seloc_cart">
INSERT INTO NavContentOld (page, description)
VALUES ('#f.filename#', '#preserveSingleQuotes(prettify(f.desc))#')
</cfquery>
</cfif>
</cfloop>
I'm getting this error:
ColdFusion was looking at the following text:
(
The CFML compiler was processing:
* an expression beginning with "preserveSingleQuotes", on line 25, column 53.This
message is usually caused by a problem in the expressions structure.
I've stared at this for 10 minutes...and I can't see anything
wrong. Removing preserveSingleQuotes makes it bomb on a value with
a single quote...
The problem shouldn't be in the prettify function, but in case
someone sees something that I don't, here it is.
function prettify(str) {
var str2 = '';
str2 = replace(str, "#chr(13)##chr(10)#","","ALL");
str2 = replace(str2, "&","","ALL");
has2space = find(" ", str2, 1);
while(has2space NEQ 0) {
str2 = replace(str2, " ", " ","one");
has2space = find(" ", str2, 1);
}
return str2;
}
--
jon
mailto:[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community.
http://www.fusionauthority.com/ads.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4