cfloop query and last row 
Author Message
 cfloop query and last row

Hello everyone,

 I was trying looping over a query which has to be executed only when the last
row of a previous loop has been reached. The question is: I have nested loops,
I am able to print the values based on two loops:

 for example: <cfloop query="advisor">
                       <cfloop students>
                       </cfloop>
                  </cfloop>
 I am able to get student values for a particular advisor and print the values
for different advisor and students. I am trying to include another loop like
grades within advisor loop which should be executed at the end of students list
for that particular advisor. What I am doingg right now is displaying the
values in a table format.

 <table>
 <tr>Advisor</tr>
 <tr>Student1<tr>
 <tr>Student2</tr>
 <tr>Grades</tr>

 How is possible to know when I would reach the end of the student loop for an
advisor and then loop the grades for the same advisor before proceeding to
another advisor?

 Any suggestions would be great.

 Thanks.



Fri, 19 Aug 2011 09:58:34 GMT
 cfloop query and last row

The group attribute of cfoutput would be a lot more efficient.  Useage is
described in the cfml reference manual.  If you don't have one, the internet
does.

 It would also be more efficient to get all your data with a single query.  



Fri, 19 Aug 2011 12:06:49 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Referencing each row inside cfloop for query

2. how to display only first and last row of query

3. Query CFLOOP inside a Query CFLOOP

4. CFLOOP QUERY within CFLOOP

5. CFLOOP Query inside a CFLOOP Index

6. Previous and Next Row Values in a CFLoop

7. Alternating row colors and cfloop?

8. Alternating row colors and cfloop?

9. CFLOOP pageset of 3 items per row

10. CFLOOP pageset of 3 items per row

11. Access Empty Row Problem with CFLOOP

12. CFLOOP or Query of Query - Newbie Help


 
Powered by phpBB® Forum Software