?
Solved

Error cannot display my list

Posted on 2011-10-31
8
Medium Priority
?
321 Views
Last Modified: 2012-05-12
Hi,

I want to display my array list.  

something is wrong in my code.
<CFQUERY DATASOURCE="xx" NAME="DeleteNonAssociatedImages" cachedwithin="#createTimeSpan(0,0,0,-1)#">
	Select PathImage1, PathImage2, PathImage3, PathImage4, 
	SmlPathImage1,SmlPathImage2,SmlPathImage3,SmlPathImage4  from ADS
	where (PathImage1 <> "" or PathImage2 <> "" or PathImage3 <> "" 
	or PathImage4 <> "" or SmlPathImage1 <> "" or SmlPathImage2 <> "" 
	or SmlPathImage3 <> "" or SmlPathImage4 <> "")
</CFQUERY>


 <cfif isDefined("DeleteNonAssociatedImages") and DeleteNonAssociatedImages.recordcount gt 0>

	<cfset myArray = ArrayNew(1)> 


	<cfloop query = "DeleteNonAssociatedImages"> 
		<cfset DisplayData = ArrayAppend(myArray,"#trim(listLast(PathImage1, "/"))#,#trim(listLast(PathImage2, "/"))#,#trim(listLast(PathImage3, "/"))#,#trim(listLast(PathImage4, "/"))#,#trim(listLast(SmlPathImage1, "/"))#,#trim(listLast(SmlPathImage2, "/"))#,#trim(listLast(SmlPathImage3, "/"))#,#trim(listLast(SmlPathImage4, "/"))#> 
	</cfloop> 


	<cfset myList = ArrayToList(myArray, ",")> 

<cfoutput>#myList#</cfoutput>

</cfif>

Open in new window

0
Comment
Question by:lulu50
  • 5
  • 3
8 Comments
 
LVL 11

Expert Comment

by:Brijesh Chauhan
ID: 37055824
Try this...

<CFQUERY DATASOURCE="xx" NAME="DeleteNonAssociatedImages" cachedwithin="#createTimeSpan(0,0,0,-1)#">
	Select PathImage1, PathImage2, PathImage3, PathImage4, 
	SmlPathImage1,SmlPathImage2,SmlPathImage3,SmlPathImage4  from ADS
	where (PathImage1 <> "" or PathImage2 <> "" or PathImage3 <> "" 
	or PathImage4 <> "" or SmlPathImage1 <> "" or SmlPathImage2 <> "" 
	or SmlPathImage3 <> "" or SmlPathImage4 <> "")
</CFQUERY>


 <cfif isDefined("DeleteNonAssociatedImages") and DeleteNonAssociatedImages.recordcount gt 0>

	<cfset myArray = ArrayNew(1)> 


	<cfloop query = "DeleteNonAssociatedImages"> 
		<cfset DisplayData = ArrayAppend(myArray,'#trim(listLast(PathImage1, "/"))#,#trim(listLast(PathImage2, "/"))#,#trim(listLast(PathImage3, "/"))#,#trim(listLast(PathImage4, "/"))#,#trim(listLast(SmlPathImage1, "/"))#,#trim(listLast(SmlPathImage2, "/"))#,#trim(listLast(SmlPathImage3, "/"))#,#trim(listLast(SmlPathImage4, "/"))#'> 
	</cfloop> 


	<cfset myList = ArrayToList(myArray, ",")> 

<cfoutput>#myList#</cfoutput>

</cfif>

Open in new window

0
 

Author Comment

by:lulu50
ID: 37055856
error


Invalid CFML construct found on line 121 at column 343.  
ColdFusion was looking at the following text:
>

The CFML compiler was processing:

an expression beginning with "ArrayAppend", on line 121, column 38.This message is usually caused by a problem in the expressions structure.
a cfset tag beginning on line 121, column 18.
a cfset tag beginning on line 121, column 18.
a cfset tag beginning on line 121, column 18.
0
 

Author Comment

by:lulu50
ID: 37055873
I tried this but get the same error too

<cfset DisplayData = ArrayAppend(myArray,"#trim(listLast(PathImage1, '/'))#,#trim(listLast(PathImage2, '/'))#,#trim(listLast(PathImage3, '/'))#,#trim(listLast(PathImage4, '/'))#,#trim(listLast(SmlPathImage1, '/'))#,#trim(listLast(SmlPathImage2, '/'))#,#trim(listLast(SmlPathImage3, '/'))#,#trim(listLast(SmlPathImage4, '/'))#">
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:lulu50
ID: 37055881
I get the same error


<cfset DisplayData = ArrayAppend(myArray,'#trim(listLast(PathImage1, "/"))#,#trim(listLast(PathImage2, "/"))#,#trim(listLast(PathImage3, "/"))#,#trim(listLast(PathImage4, "/"))#,#trim(listLast(SmlPathImage1, "/"))#,#trim(listLast(SmlPathImage2, "/"))#,#trim(listLast(SmlPathImage3, "/"))#,#trim(listLast(SmlPathImage4, "/"))#'>
0
 
LVL 11

Expert Comment

by:Brijesh Chauhan
ID: 37055981
Hmmm.. let us seprate the list out.. can you try this one, I think we are missing on ')' in above code..


<CFQUERY DATASOURCE="xx" NAME="DeleteNonAssociatedImages" cachedwithin="#createTimeSpan(0,0,0,-1)#">
	Select PathImage1, PathImage2, PathImage3, PathImage4, 
	SmlPathImage1,SmlPathImage2,SmlPathImage3,SmlPathImage4  from ADS
	where (PathImage1 <> "" or PathImage2 <> "" or PathImage3 <> "" 
	or PathImage4 <> "" or SmlPathImage1 <> "" or SmlPathImage2 <> "" 
	or SmlPathImage3 <> "" or SmlPathImage4 <> "")
</CFQUERY>


 <cfif isDefined("DeleteNonAssociatedImages") and DeleteNonAssociatedImages.recordcount gt 0>

	<cfset myArray = ArrayNew(1)> 


	<cfloop query = "DeleteNonAssociatedImages"> 
    	<cfset imglist = '#trim(listLast(PathImage1, "/"))#' & ',' & '#trim(listLast(PathImage2, "/"))#' & ',' & '#trim(listLast(PathImage3, "/"))#' & ',' & '#trim(listLast(PathImage4, "/"))#' & ',' & '#trim(listLast(SmlPathImage1, "/"))#' & ',' & '#trim(listLast(SmlPathImage2, "/"))#' & ',' & '#trim(listLast(SmlPathImage3, "/"))#' & ',' & '#trim(listLast(SmlPathImage4, "/"))#' />
		<cfset DisplayData = ArrayAppend(myArray, "#imgList#")> 
	</cfloop> 


	<cfset myList = ArrayToList(myArray, ",")> 

<cfoutput>#myList#</cfoutput>

</cfif>

Open in new window

0
 
LVL 11

Accepted Solution

by:
Brijesh Chauhan earned 2000 total points
ID: 37055994
This is your original code.. the last ')' closing bracket is missing..

<CFQUERY DATASOURCE="xx" NAME="DeleteNonAssociatedImages" cachedwithin="#createTimeSpan(0,0,0,-1)#">
	Select PathImage1, PathImage2, PathImage3, PathImage4, 
	SmlPathImage1,SmlPathImage2,SmlPathImage3,SmlPathImage4  from ADS
	where (PathImage1 <> "" or PathImage2 <> "" or PathImage3 <> "" 
	or PathImage4 <> "" or SmlPathImage1 <> "" or SmlPathImage2 <> "" 
	or SmlPathImage3 <> "" or SmlPathImage4 <> "")
</CFQUERY>


 <cfif isDefined("DeleteNonAssociatedImages") and DeleteNonAssociatedImages.recordcount gt 0>

	<cfset myArray = ArrayNew(1)> 


	<cfloop query = "DeleteNonAssociatedImages"> 
		<cfset DisplayData = ArrayAppend(myArray,'#trim(listLast(PathImage1, "/"))#,#trim(listLast(PathImage2, "/"))#,#trim(listLast(PathImage3, "/"))#,#trim(listLast(PathImage4, "/"))#,#trim(listLast(SmlPathImage1, "/"))#,#trim(listLast(SmlPathImage2, "/"))#,#trim(listLast(SmlPathImage3, "/"))#,#trim(listLast(SmlPathImage4, "/"))#')> 
	</cfloop> 


	<cfset myList = ArrayToList(myArray, ",")> 

<cfoutput>#myList#</cfoutput>

</cfif>

Open in new window

0
 

Author Comment

by:lulu50
ID: 37056246
ah, great!!!!

thank you
0
 

Author Closing Comment

by:lulu50
ID: 37056248
Thank you
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question