Question
ListQualify issue
The situation is this ...
I have a 'get' form that has many 'multiple select' fields. Some of the
fields contain numeric values and some text values.
So when I am searching on the returned values - I can easily use the
following syntax..
SELECT ID FROM table WHERE style IN(#URL.style#) When url.style=1,2,3,4
However If I use
SELECT ID FROM table WHERE background IN(#URL.background#) When
URL.background = black,blue,red
Of course it will not work.
So I tried using the following
<cfset URL.Background = ListQualify(URL.Background,"'",",","CHAR")>
Now if I dump URL.background - I get 'black','blue','red'
This is what I want. However if I then use the above SQL statement - I
get a cf error stating Error Executing Database Query and the sample
query reads like this...
SELECT ID FROM table WHERE background IN (''Black'',''Blue'')
NOW I know that isn't right - but where did the extra single quotes come
from?
I don't know the semantics of it all - but when I submit the form - the
url reads like this...
someurl/file.cfm?Background=Black&Background=Blue I don't know if that
would shed some light.
Any ideas - anyone?
Thanks!
Chris
I have a 'get' form that has many 'multiple select' fields. Some of the
fields contain numeric values and some text values.
So when I am searching on the returned values - I can easily use the
following syntax..
SELECT ID FROM table WHERE style IN(#URL.style#) When url.style=1,2,3,4
However If I use
SELECT ID FROM table WHERE background IN(#URL.background#) When
URL.background = black,blue,red
Of course it will not work.
So I tried using the following
<cfset URL.Background = ListQualify(URL.Background,"'",",","CHAR")>
Now if I dump URL.background - I get 'black','blue','red'
This is what I want. However if I then use the above SQL statement - I
get a cf error stating Error Executing Database Query and the sample
query reads like this...
SELECT ID FROM table WHERE background IN (''Black'',''Blue'')
NOW I know that isn't right - but where did the extra single quotes come
from?
I don't know the semantics of it all - but when I submit the form - the
url reads like this...
someurl/file.cfm?Background=Black&Background=Blue I don't know if that
would shed some light.
Any ideas - anyone?
Thanks!
Chris
