• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfloop query problems

New Here ,
Dec 11, 2006 Dec 11, 2006

Copy link to clipboard

Copied

I'm trying to loop through a query this is what i have as code:
for some reason it is giving me the output going like this 4wd 4wd rwd rwd rwd
and i want it to be like this
4wd
4wd
rwd
rwd
rwd

any help would be appreciated
TOPICS
Advanced techniques

Views

219

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 11, 2006 Dec 11, 2006

Copy link to clipboard

Copied

LATEST
From the code, it looks like the problem is that you are generating multiple table columns in one row, where you really want multiple rows with one column. Try this:


<cfif #Recordset9.DriveTypeID# GT 0>
<cfset total_records=Recordset9.recordcount>
<table>
<cfloop index="Counter" from=1 to="#Total_Records#" step="1">
<cfoutput>
<tr>
<td ><center>
<font size="4" face="Arial, Helvetica, sans-serif">#madrive[Counter][1][1]#<br></font>
</center></td></tr>
</cfoutput>
</cfloop>
</table>
</cfif>

or if you didn't need it in a table, you could remove the <td>'s and </td>'s from your original example and it should display them vertically.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation