How to move to next record

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default How to move to next record

    Hi,
    I am working on an application,that requires the records to be displayed in 2
    columns..
    So i need something like this..
    <tr>
    <td>recordsetvalue</td>
    <td>nextrecordsetvalue</td>
    </tr>

    I am not sure how to the next recordset..is there any cursors in coldfusion
    through which i can manualy move ot the next record..

    Thx
    AL

    alagukannan Guest

  2. Similar Questions and Discussions

    1. How can i retrieve record ONLY From 300 - 400 in amillion Record Table?
      HI all Thanks for your time.. I have a question here.. How can i retrieve record ONLY From XXX - XXX in a million Record Table? eg. I have a...
    2. Move to specific record
      hii peeps, what i want to knowe is.. where i can find a extension fore: move to specifi record ore it exist..? greets Ej.
    3. PHP extension Move to specific record
      Hi there, I'm searching for the move to specific record extension for PHP. Does anybody know where to find it? If so... please let me know ...
    4. move record from 1 table to another table
      how can i move info from 1 table to another? I have a table with a form. The table and the form are called customer. I want to move selected...
    5. Stop adding record in subform after record count = 1
      Can someone help in in what to put after the THEN statment to allow one entry if the Record count is =>1 in the Before insert or should I set the...
  3. #2

    Default Re: How to move to next record

    Hi,
    I am using coldfusion 6.1 mx and oracle 9i.
    I am using cfquery tag.


    thx
    AL
    alagukannan Guest

  4. #3

    Default Re: How to move to next record

    Try using CFLOOP stepping by 2

    i.e.
    <tr>
    <CFLOOP from="1" to="#query.recordcount#" index="ThisLoop" step="2">
    <CFOUTPUT>
    <td>query.column[ThisLoop]</td>
    <td>query.column[ThisLoop + 1]</td>
    </CFOUTPUT>
    </CFLOOP>
    </tr>

    You may need to play with it a bit, but it should work.



    SafariTECH Guest

  5. #4

    Default Re: How to move to next record

    Hi AL

    You can loop over the whole query and then just close the row and start a new
    one after every 2nd record. MOD 2 will return 0 if the value is 2 or 4 as there
    is no remainder when dividing by 2 so that is when you want to do the </TR><TR>
    bit.

    This way you can modify the code to be MOD 3 or MOD 4 to have different number
    of columns.

    HTH

    Zoe

    <TR>
    <CFLOOP QUERY="QueryName">
    <TD>#ColumnOutput#</TD>
    <CFIF CurrentRow MOD 2 EQ 0 AND NOT CurrentRow EQ RecordCount> <!--- for
    items 2, 4 .. close the ROW tag and start a new row --->
    </TR><TR>
    </CFIF>
    </CFLOOP>
    </TR>

    zoeski80 Guest

  6. #5

    Default Re: How to move to next record

    HI All,
    Thx for helping...

    with regards
    AL
    alagukannan Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139