jrottman
Programmer
- Jun 17, 2005
- 47
I have a fielda in my database, fld_bagent. In both this field I am storing the agent Id attached to a particular file number.
What I am trying to do is query my userlist table agaist the list. So that for every entry into the list, I can return all the user information for that user.
Here is what I am trying but it is only displaying one record instead of all the records for the query.
<cfquery name="test" datasource="#application.dsn#">
select * from tbl_smartPanel_propInfo_Sale
where fld_fileNum = 'S060099'
</cfquery>
<cfset agentList = ListAppend(test.fld_bagentId1, test.fld_sagentId1)>
<cfset counter = 1>
<cfloop from="1" to="#ListLen(agentList)#" index="counter">
<cfquery name="agentDisplay" datasource="#application.dsn#">
select * from tbl_smartPanel_userList
where fld_userlogin = '#ListGetAt(agentList, counter)#'
</cfquery>
<cfset counter = counter + 1>
</cfloop>
<cfoutput query="agentDisplay">#fld_fullname#</cfoutput>
What I am trying to do is query my userlist table agaist the list. So that for every entry into the list, I can return all the user information for that user.
Here is what I am trying but it is only displaying one record instead of all the records for the query.
<cfquery name="test" datasource="#application.dsn#">
select * from tbl_smartPanel_propInfo_Sale
where fld_fileNum = 'S060099'
</cfquery>
<cfset agentList = ListAppend(test.fld_bagentId1, test.fld_sagentId1)>
<cfset counter = 1>
<cfloop from="1" to="#ListLen(agentList)#" index="counter">
<cfquery name="agentDisplay" datasource="#application.dsn#">
select * from tbl_smartPanel_userList
where fld_userlogin = '#ListGetAt(agentList, counter)#'
</cfquery>
<cfset counter = counter + 1>
</cfloop>
<cfoutput query="agentDisplay">#fld_fullname#</cfoutput>