List Info

Thread: can anyone join these 2 cfquery for me?




can anyone join these 2 cfquery for me?
user name
2006-08-13 08:17:30
hi
i have 2 cfquery and i want them to be in one cfoutput in a
page, can
anyone help?

before that, my DB column is :
member_ID | member_Name | upline_ID | memberType

____________________________________________________________

<cfparam default="001"
name="currentMember"
type="integer">
<cfparam default=""
name="downlineList">

<cfquery datasource="moy-network"
name="get_Downline">
	SELECT
		member_ID
	FROM
		tbl_member
	WHERE
		upline_ID = '#currentMember#'
</cfquery>

	<cfoutput query="get_Downline">
		<cfset downlineList = downlineList &
"'" & "#member_ID#" &
"'" & ",">
	</cfoutput>

<cfquery datasource="moy-network"
name="get_2ndLevel_Downline">
		SELECT
			COUNT(member_ID) AS totalDownline
		FROM
			tbl_member
		WHERE
			upline_ID
			IN (
			<cfoutput>#preservesinglequotes(downlineList)#</
cfoutput>
			)
		GROUP BY
			upline_ID
	</cfquery>
____________________________________________________________
___

and the final output will be:

<cfloop query="xxx">
  <cfoutput>
  <tr>
    <td>#member_ID#</td>
    <td>#member_Name#</td>
    <td>#member_Type#</td>
    <td>#totalDownline#</td>
  </tr>
  </cfoutput>
  </cfloop>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "ColdFusion" group.
To post to this group, send email to ColdFusiongooglegroups.com
To unsubscribe from this group, send email to
ColdFusion-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps.google.com/group/ColdFusion
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )