SELECT
i.*,
it.*
FROM Issue i
INNER JOIN IssueType it ON i.IssueTypeID = it.IssueTypeID
ORDER BY it.IssueTitle
<cfoutput query="theQuery" group="IssueTitle">
#theQuery.IssueTitle#<br />
<cfoutput>
#theQuery.Issue#<br />
</cfoutput>
</cfoutput>
That's the gist of it, change the columns the the ones you want and see what
happens. :O)
Ade
-----Original Message-----
From: Brett Barnhart [mailto:[EMAIL PROTECTED]
Sent: 20 August 2004 00:27
To: CF-Community
Subject: CFLoop to pull up categories and sub-categories
This is a combination of CF and SQL question.
I have 2 tables that reference each other. One is Issue type and the other
is Issue.
I am using these to build a FAQ page.
What I want is output that looks like this...
Installation Problems
--- Installing on a Mac
--- Installing on Windows
--- Key Code Problems
Report Problems
--- How to export in XML
--- Finding the right values
Doing research, CFLoop seems to be the thing I want to use, but I am having
trouble getting it going.
SQL is very simple here
<CFQUERY DATASOURCE="testmove" NAME="qryGetIssueTypes">
select distinct kit.IssueTypeId
, kit.DisplayText IssueText
, kit.DisplayOrder
from kbissues ki
, kbissuetypes kit
where ki.issuetypeid = kit.issuetypeid
and ki.ProductID=#form.LocalProductID#
order by kit.DisplayOrder
</cfquery>
and
<CFQUERY DATASOURCE="testmove" NAME="qryGetIssueTitles">
select ki.IssueID
, ki.IssueTitle
where ki.issuetypeid = #qryGetIssues.IssueTypeID#
and ki.ProductID=#form.LocalProductID#
</cfQuery>
I tried to do this, which failed miserably
<table>
<cfoutput QUERY="qryGetIssueTypes">
<tr><td colspan=2><strong>#qryGetIssues.IssueText#</strong></td></tr>
<CFQUERY DATASOURCE="testmove" NAME="qryGetIssueTitles">
select ki.IssueID
, ki.IssueTitle
from kbissues ki
where ki.issuetypeid = #qryGetIssues.IssueTypeID#
and ki.ProductID=#form.LocalProductID#
</cfQuery>
<cfoutput QUERY="qryGetIssueTitles">
<tr><td width=30></td><td>#qryGetIssueTitles.IssueTitle#</td></tr>
</cfoutput>
</cfoutput>
</table>
Help is greatly appreciated!!
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
