Newbie Using Arrays--Array Runs But Output is Incorrect

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Newbie Using Arrays--Array Runs But Output is Incorrect

    I'm trying to build a dynamic table with a 2D array. My array runs, but the
    output which should be 00 is 000000000.

    My goal is to output a table with drill-down links that looks like the
    following. I created my array based on the column and row headings which are
    looked at to create the proper "suffix"/output.

    0 1 2 3 4 5 6 7 8 9 A B C....
    0 00 01...
    1 10 11...
    2 20 21..
    3 30 31...

    My test code follows (the <cfloop> I'll add later):

    <cfset aSfx=ArrayNew(2)>
    <cfset aSfx[1][1]="0">
    <cfset aSfx[1][2]="1">
    <cfset aSfx[1][3]="2">
    <cfset aSfx[1][4]="3">
    <cfset aSfx[1][5]="4">
    <cfset aSfx[1][6]="5">
    <cfset aSfx[1][7]="6">
    <cfset aSfx[1][8]="7">
    <cfset aSfx[1][9]="8">
    <cfset aSfx[1][10]="9">
    <cfset aSfx[1][11]="A">
    <cfset aSfx[1][12]="B">
    <cfset aSfx[1][13]="C">
    <cfset aSfx[1][14]="D">
    <cfset aSfx[1][15]="E">
    <cfset aSfx[1][16]="F">
    <cfset aSfx[1][17]="G">
    <cfset aSfx[1][18]="H">
    <cfset aSfx[1][19]="I">
    <cfset aSfx[1][20]="J">
    <cfset aSfx[1][21]="K">
    <cfset aSfx[1][22]="L">
    <cfset aSfx[1][23]="M">
    <cfset aSfx[1][24]="N">
    <cfset aSfx[1][25]="O">
    <cfset aSfx[1][26]="P">
    <cfset aSfx[1][27]="Q">
    <cfset aSfx[1][28]="R">
    <cfset aSfx[1][28]="S">
    <cfset aSfx[1][29]="T">
    <cfset aSfx[1][30]="U">
    <cfset aSfx[1][31]="V">
    <cfset aSfx[1][32]="W">
    <cfset aSfx[1][33]="X">
    <cfset aSfx[1][34]="Y">
    <cfset aSfx[1][35]="Z">


    <cfset aSfx[2][1]="0">
    <cfset aSfx[3][1]="1">
    <cfset aSfx[4][1]="2">
    <cfset aSfx[5][1]="3">
    <cfset aSfx[6][1]="4">
    <cfset aSfx[7][1]="5">
    <cfset aSfx[8][1]="6">
    <cfset aSfx[9][1]="7">
    <cfset aSfx[10][1]="8">
    <cfset aSfx[11][1]="9">
    <cfset aSfx[12][1]="A">
    <cfset aSfx[13][1]="B">
    <cfset aSfx[14][1]="C">
    <cfset aSfx[15][1]="D">
    <cfset aSfx[16][1]="E">
    <cfset aSfx[17][1]="F">
    <cfset aSfx[18][1]="G">
    <cfset aSfx[19][1]="H">
    <cfset aSfx[20][1]="I">
    <cfset aSfx[21][1]="J">
    <cfset aSfx[22][1]="K">
    <cfset aSfx[23][1]="L">
    <cfset aSfx[24][1]="M">
    <cfset aSfx[25][1]="N">
    <cfset aSfx[26][1]="O">
    <cfset aSfx[27][1]="P">
    <cfset aSfx[28][1]="Q">
    <cfset aSfx[29][1]="R">
    <cfset aSfx[30][1]="S">
    <cfset aSfx[31][1]="T">
    <cfset aSfx[32][1]="U">
    <cfset aSfx[33][1]="V">
    <cfset aSfx[34][1]="W">
    <cfset aSfx[35][1]="X">
    <cfset aSfx[36][1]="Y">
    <cfset aSfx[37][1]="Z">

    <cfquery name="qGroupSfx" datasource="CopyPCN">
    SELECT pcn.ref, pcn.sfx
    FROM pcn
    WHERE 0=0
    ORDER BY sfx
    </cfquery>

    <!--- <cflocation url="PIDSearchArray.cfm" addtoken="yes"> --->

    <cfquery name="qPIDCount" datasource="CopyPCN">
    SELECT COUNT (pcn.sfx) AS sfx_count
    FROM pcn
    GROUP BY pcn.sfx
    ORDER BY pcn.sfx
    </cfquery>Text

    FusionRed Guest

  2. Similar Questions and Discussions

    1. Incorrect output in PrintDataGrids
      Hello Flex Community, I have an exciting problem and hope anybody can help me. My application does the following: 1. I have a panel with two...
    2. #40037 [NEW]: Incorrect output from strtotime, when timestr is used with a relative term this
      From: shruti224 at yahoo dot com Operating system: ES4 PHP version: 5.2.0 PHP Bug Type: Date/time related Bug description: ...
    3. #39830 [NEW]: Incorrect (float) variable output after using setlocale
      From: ipa at beta dot lt Operating system: Linux 2.6.10 PHP version: 4.4.4 PHP Bug Type: Variables related Bug description: ...
    4. output large arrays to html
      Hello, I'm looking for ways to 'echo' a single large associative array repeatedly w/ as little overhead as possible. I'm developing a simple...
    5. #24433 [Com]: Incorrect version-output
      ID: 24433 Comment by: kuraman10 at yahoo dot com Reported By: sandro dot mathys at blappy dot com Status: Bogus...
  3. #2

    Default Re: Newbie Using Arrays--Array Runs But Output isIncorrect

    Subsequent observation--it appears to be producing one output for each row in the database (9 rows of 00, producing 9 pairs of 00). Help, please.

    Red
    FusionRed Guest

  4. #3

    Default Re: Newbie Using Arrays--Array Runs But Output isIncorrect

    In case anyone has a similar problem, I solved my problem output by using "group" in the query.
    FusionRed 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