janewilliams20: (geek)
[personal profile] janewilliams20
The answer to all questions, that is.

I've just been trying to use CF to set up some SQL to put a URL into a table. The URL was straight out of a stored value, not from the user, so no danger of injection:

update mytable
set mycol = "#myurl#"

right?

Wrong. All the "\" characters in the URL get interpreted as escape characters.
Yes, you can mess around replacing \ by \\, or you can do this:

set mycol= <cfqueryparam cfsqltype="cf_sql_varchar" value="#myurl#">,

And it automagically sorts it for you.


If I hadn't been so fuzzy-headed last night, I'd have spotted that in moments. I hate being ill!
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

janewilliams20: (Default)
janewilliams20

June 2020

S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 21st, 2025 01:13 pm
Powered by Dreamwidth Studios