Yep that's worth a try. Looks like the difference is that the first one is only querying one column, so it finds the transformation to array simple enough.
-----Original Message----- From: Rich Wild [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 10, 2003 11:45 AM To: '[EMAIL PROTECTED]' Subject: RE: [ cf-dev ] ArrayToList rather than use arraytolist(), try using valuelist(query.column) and see what that gives you... > -----Original Message----- > From: Ian Westbrook [mailto:[EMAIL PROTECTED] > Sent: 10 June 2003 11:46 > To: cfug dev list > Subject: [ cf-dev ] ArrayToList > > > Hi > got pissed on red wine last night, so head not very clear... > > y'all may remember that the other day I did an ArrayToList: > > <cfquery datasource="#dsn#" name="userartforms"> > SELECT artformid > FROM artformjoin > WHERE userid = #session.userid# > </cfquery> > > <cfoutput> > <cfset myartforms = ArrayToList(#userartforms.artformid#, ',')> > </cfoutput> > > which all worked fine. > > so why the hell isn't this working: > > <cfquery datasource="#dsn#" name="userartforms"> > SELECT artformjoin.userid, artformjoin.artformid, > artforms.id, artforms.artform > FROM artformjoin, artforms > WHERE artformjoin.userid = #session.userid# > AND artformjoin.artformid = artforms.id > ORDER BY artformjoin.artformid > </cfquery> > > <cfif userartforms.RecordCount IS NOT 1> // RC is 4 for test > data - see below, and RC will always be at least 1 as the > user has to choose at least 1 artform during registration > > <cfoutput> > <cfset myartforms = ArrayToList(userartforms.artformid, ',')> > </cfoutput> > > <cfquery datasource="#dsn#" name="getevents"> > SELECT id > FROM diary > WHERE artform IN (#myartforms#) > </cfquery> > > <cfelse> > > <cfquery datasource="#dsn#" name="getevents"> > SELECT id > FROM diary > WHERE artform = #userartforms.artformid# > </cfquery> > > </cfif> > > error message: > > An error has occurred. > > An error occurred while evaluating the expression: > > > myartforms = ArrayToList(userartforms.artformid, ',') > > > Error near line 15, column 7. > -------------------------------------------------------------- > ------------------ > > Parameter 1 of function ArrayToList which is now "8" must be > an indexed object such as an array or a query column > > > I did some error-checking with this code: > > <cfoutput> > RC: #userartforms.RecordCount# > </cfoutput> > <br><br> > <cfoutput> > #userartforms.artformid#, > </cfoutput> > <cfabort> > > which output: > RC: 4 > > 8, > > so only the first item of the array is coming out (there > should be 4 elements, as the RC correctly picked up). > > anyone any ideas? > > I was having a good morning, too... ;-) > > 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. > -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] DISCLAIMER: This e-mail is confidential and may also be legally privileged. If you are not the intended recipient, use of the information contained in this e-mail (including disclosure, copying or distribution) is prohibited and may be unlawful. Please inform the sender and delete the message immediately from your system. This e-mail is attributed to the sender and may not necessarily reflect the views of the patsystems Group and no member of the patsystems Group accepts any liability for any action taken in reliance on the contents of this e-mail (other than where it has a legal or regulatory obligation to do so) or for the consequences of any computer viruses which may have been transmitted by this e-mail. The patsystems Group comprises patsystems plc and its subsidiary group of companies. -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
