I have a query:
SELECT id FROM table WHERE field1=<cfqueryparam value="#URL.field1#"
cfsqltype="cf_sql_varchar">
AND field2=<cfqueryparam value="#URL.field2#"
cfsqltype="cf_sql_varchar">
AND field3=<cfqueryparam value="#URL.field3#"
cfsqltype="cf_sql_varchar">;
Id is an INTEGER in MySQL, but the above query returns an Id that has not come from the table, and is not even an INTEGER, it seems to be a random BIGINT! If I remove the CFQUERYPARAM it works though...
SELECT id FROM table WHERE field1='#URL.field1#'
AND field2='#URL.field2#'
AND field3='#URL.field3#';
Field1, Field2 and Field3 are all VARCHARS in the Database, but in the URL they contain "+", eg
Field1=text+moretext
If I remove the "+" from the URL strings, it works fine! I'm aware the "+" is a representation of a space, if I actually type a whitespace into the URL again it works fine. It's only breaking when there is a "+" present.
What have I done wrong? Or what do I do to make CFQUERYPARAM work with "+" from the URL