How do I get multiple hyperlinks to diplay in a query output?
I am using two tables to list all of the sport teams for a school. The sports table lists all of the team data grouped by gender. The second table uses the sportID from the first table to associate the team with a schedule. The problem is not all teams have a schedule yet.
I am trying to display a link for those teams with schedules. I compare the two tables, sports & schedule and use a CFIF statement to compare the 2 sportIDs in the output to determine which teams have a schedule. If the two sportIDs match then a hyperlink is displayed.
Unfortuanetely, only one link will be displayed, even though there should be three links. Below is my code:
Table to display the teams grouped by gender
<cfquery name="getSports" datasource="#application.database#">
select gender, team, levels, sportID
from sports
group by gender, team, levels, sportID
</cfquery>
Table used to get the sportID for schedules already created
<cfquery name="getID" datasource="#application.database#">
select sportID
from schedules
group by sportID
</cfquery>
I then compare the sportIDs and if they match, I then display a hyperlink
<cfoutput query="getSports" group="gender">
<h1">#gender#'s Teams</h1>
<ul>
<cfoutput>
<li>
<cfif getID.sportID EQ getSports.sportID><a href="teams.cfm?sportID=#sportID#"></cfif>
#team# <cfif levels GT "">(#levels#)</cfif> //levels is used to differentiate between J.V. and Varsity. Not all teams use levels
<cfif getID.sportID EQ getSports.sportID></a></cfif>
</li>
</cfoutput>
</ul>
</cfoutput>
How do I get the other teams to display their links?
