Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to point query result to the next record in a cfoutput?

Status
Not open for further replies.

wminghao

Programmer
May 29, 2000
24
US
inside cfoutput, I output my SELECT query<br><br>&lt;cfoutput query=&quot;abc&quot;&gt;<br>&nbsp;&lt;tr&gt;<br>&nbsp;&nbsp;&lt;td&gt;<br>&nbsp;&nbsp;&nbsp;#abc.Name#<br>&nbsp;&nbsp;&lt;/td&gt;<br>&nbsp;&lt;tr&gt; <br>&lt;/cfoutput&gt;<br>&nbsp;<br>But I wish to disply two &lt;td&gt; in one &lt;tr&gt;, the second&nbsp;&nbsp;points to the next record of the query result.<br>&nbsp;&nbsp;&nbsp;<br>In ASP it is like:&nbsp;&nbsp;recordset.MoveNext<br>then the pointer is moved to the next record.<br><br>How to do in Coldfusion?<br><br><br>&nbsp;<br>
 
Here's how I do it...<br><FONT FACE=monospace><br>&lt;tr&gt;<br>&nbsp;&nbsp;&lt;cfoutput query=&quot;abc&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#name#<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;cfif currentrow mod 2 is 0&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/cfif&gt;<br>&nbsp;&nbsp;&lt;/cfoutput&gt;<br>&lt;/tr&gt;<br></font><br>You can change the 2 to any number to get as many columns as you wish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top