1 Reply Latest reply on Dec 11, 2006 8:42 AM by insuractive

    cfloop query problems

    mactech999 Level 1
      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
        • 1. Re: cfloop query problems
          insuractive Level 3
          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.