• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Help with a query

Guest
Aug 28, 2006 Aug 28, 2006

Copy link to clipboard

Copied

I am working on a search system, that allows admins to return very specific data. The most important part of the search is returning a certain columns results as a list. The problem I have is this.

When I run my test, I get an array of stuctures output like this.
1
struct
ADDRESS 1222 W Baseline Road
AGENTLIST Patrick Richardson
COE 05/31/2005
FILENUM S051990
MLSNUM [empty string]
PRICE 158875
STATUS Closed
2
struct
ADDRESS 1222 W Baseline Road
AGENTLIST Jason Robinson
COE 05/31/2005
FILENUM S051990
MLSNUM [empty string]
PRICE 158875
STATUS Closed

But I need the returned output to look like this.
1
struct
ADDRESS 1222 W Baseline Road
AGENTLIST Patrick Richardson,Jason Robinson
COE 05/31/2005
FILENUM S051990
MLSNUM [empty string]
PRICE 158875
STATUS Closed


I have tried looping over the results and creating a list based on the returned objects from the query. But it only places the first record int he list and outputs that only.

This is my current code that I am trying below. Can someone give me a hand with this?

TOPICS
Advanced techniques

Views

293

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 28, 2006 Aug 28, 2006

Copy link to clipboard

Copied

The group attribute of <cfoutput> would help with this task.

This is not debugged or tested, but should get you close.

<cfoutput query="SaleSearchQry" group="fld_partName">
<cfset searchArr = structNew()>
<cfset searchArr
.fileNum = SaleSearchQry.fld_fileNum>
<cfoutput>
<cfset searchArr .agentList =
listAppend(searchArr
.agentList,SaleSearchQry.fld_partyName)>
</cfoutput>
<cfset searchArr .mlsNum = SaleSearchQry.fld_mlsNum>
<cfset searchArr
.status = SaleSearchQry.fld_propStatus>
<cfset searchArr .address = SaleSearchQry.fld_propAddress>
<cfset searchArr
.coe = SaleSearchQry.fld_propCoe>
<cfset searchArr .price = SaleSearchQry.fld_propPrice>
<cfset i = i + 1>
</cfoutput>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 28, 2006 Aug 28, 2006

Copy link to clipboard

Copied

LATEST
Note to Ian. The macromedia site version of this uses square brackets to create html. For example [the letter i] gets interpreted as the html <i> tag. Notice how it looks here: http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=1187622&ente...

Just thought you'd like to know.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation