railo

ColdFusion - When to use the “request” scope?

我与影子孤独终老i 提交于 2019-11-29 01:32:38
Been going over my predecessor's code and see usage of the "request" scope frequently. What is the appropriate usage of this scope? Adam Tuttle There are several scopes that are available to any portion of your code: Session, Client, Cookie, Application, and Request. Some are inadvisable to use in certain ways (i.e. using Request or Application scope inside your Custom Tags or CFC's; this is coupling , violates encapsulation principles, and is considered a bad practice), and some have special purposes: Cookie is persisted on the client machine as physical cookies, and Session scoped variables

ColdFusion - When to use the “request” scope?

馋奶兔 提交于 2019-11-27 16:04:20
问题 Been going over my predecessor's code and see usage of the "request" scope frequently. What is the appropriate usage of this scope? 回答1: There are several scopes that are available to any portion of your code: Session, Client, Cookie, Application, and Request. Some are inadvisable to use in certain ways (i.e. using Request or Application scope inside your Custom Tags or CFC's; this is coupling, violates encapsulation principles, and is considered a bad practice), and some have special

ColdFusion adding extra quotes when constructing database queries in strings

为君一笑 提交于 2019-11-26 23:11:17
I am coding in ColdFusion, but trying to stay in cfscript, so I have a function that allows me to pass in a query to run it with <cfquery blah > #query# </cfquery> Somehow though, when I construct my queries with sql = "SELECT * FROM a WHERE b='#c#'" and pass it in, ColdFusion has replaced the single quotes with 2 single quotes. so it becomes WHERE b=''c'' in the final query. I have tried creating the strings a lot of different ways, but I cannot get it to leave just one quote. Even doing a string replace has no effect. Any idea why this is happening? It is ruining my hopes of living in

ColdFusion adding extra quotes when constructing database queries in strings

隐身守侯 提交于 2019-11-26 07:49:13
问题 I am coding in ColdFusion, but trying to stay in cfscript, so I have a function that allows me to pass in a query to run it with <cfquery blah > #query# </cfquery> Somehow though, when I construct my queries with sql = \"SELECT * FROM a WHERE b=\'#c#\'\" and pass it in, ColdFusion has replaced the single quotes with 2 single quotes. so it becomes WHERE b=\'\'c\'\' in the final query. I have tried creating the strings a lot of different ways, but I cannot get it to leave just one quote. Even