Hi
I've got a table 'artformjoin', which is

id // autonumber
userid // = users.id, number
artformid // = artforms.id, number

to keep track of a user's artform choices. I want the user to be able to change their 
prefs (obviously), but can't find a function to do a string comparison. This the 
pseudo code that I thought of (haven't tried it yet, cause can't find the right 
function!):

<cfquery datasource="#dsn'#" name="userartforms">
SELECT artformid
FROM artformjoin
WHERE userid = #session.userid#
</cfquery>

<cfoutput>
<cfset myartforms = ArrayToList(#userartforms.artformid#, ',')>
 </cfoutput>

which should create a string/list (might be '1,5,11,19')

then I thought I might do:

<cfquery datasource="#dsn'#" name="artforms">
SELECT id, artform
FROM artforms
ORDER BY artform
</cfquery>

<form...>
<cfoutput query="artforms">
#artform# <input type="checkbox" name="artform" value="#id#" <cfif 
stringcontains(myartforms, id)> CHECKED><cfelse>></cfif>> <br>
</cfoutput>
</form>

// ie list all the artforms, with the user's current choices checked

which function can I use that I've called 'stringcontains' ?

or is there a better way of doing it altogether?

TIA

Ian W

Ian Westbrook,
FutureDream Media Limited,
(W): www.futuredream.net
(E): [EMAIL PROTECTED]
(T): +44 (0) 1303 258 985
(M): 07939 510 812

This message may contain information which is legally privileged and/or confidential. 
If you are not the intended recipient, you are hereby notified that any unauthorised 
disclosure, copying, distribution or use of this information is strictly prohibited. 
Such notification notwithstanding any comments, opinions, information or conclusions 
expressed in this message are those of the originator, not of FutureDream Media Ltd, 
unless otherwise explicitly and independently indicated by an authorised 
representative of FutureDream Media Ltd.

Reply via email to