Copy link to clipboard
Copied
I need help! I need the red to repeat and not sure what changes I make. Its something with the cfoutput query but not sure how to change it. Help!
CODE:
<cfquery name="getClasses" datasource="Users">
SELECT *
FROM StudentClasses
WHERE SID = #session.auth.SID#
</cfquery>
<cfquery name="getClassEvaluation" datasource="Users">
SELECT *
FROM ClassEvaluation
WHERE ID = #getClasses.ID#
</cfquery>
<div id="student-review-time">
<h2>Class Evaluation Form</h2>
<h3>Please Complete the Following Class Evaluations</h3>
<cfoutput query="getClasses"><h3>#Class# - #Teacher# - </h3>
<cfif "#getClassEvaluation.ID#" eq "#ID#">
<h3>Survey Complete</h3>
<cfelse>
<h3><a href="student_feedback.cfm?ID=#ID#">Take Survey</a></h3>
</cfif></cfoutput>
</div>
Copy link to clipboard
Copied
First, you only need one query, not two.
Second, you appear to be looping (using cfoutput) through a query that has only one row.