Display Array Value based off 2nd array value?

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Display Array Value based off 2nd array value?

    I have an array that contains a number. This number tells me which row in the
    2nd array I need. So basically, if array1 is 2, I need the 2nd row in the 2nd
    array to display a value.

    FOR EXAMPLE
    #session.FIRSTARRAY[1][1]# IS 2

    HOW CAN I LOOP THROUGH
    #SESSION.SECONDARRAY[2]# AND DISPLAY THE 2ND ROW VALUE ?

    DOES THAT MAKE SENSE TO YOU?

    Right now it's choking on my if I use the first array value in the 2nd array
    value like this
    #SESSION.SECONDARRAY[#session.FIRSTARRAY[1][1]#][2]#


    Scooby Doobie Doo Guest

  2. Similar Questions and Discussions

    1. How to display CFC array of structures in a Flexdatagrid?
      Hi, I had the above process working at some point, but for unknown reasons, it has stopped working. Quite simply, my CFC returns an array of...
    2. Fetch array, display and update, all in one.. ?
      Hi All, I have designed a debit-system database with a PHP frontend. The amounts need to be updated on a monthly basis. now i have 10 clients in...
    3. increment an array element to display jpg's ...
      I'm reading a directory of pictures , and trying to display them nicely formated in a table 4 accross... a few issues .. My play with array's...
    4. [PHP] How to store result in array for later display?
      In the following code snippet, I populate an array called $emp_final, which works fine, as I can tell if I uncomment the echo immediately after. If...
    5. Unable to display stored array
      In the following code snippet, I build an array called $emp_final, which I attempt to echo later on. If I uncomment the echo immediately after the...
  3. #2

    Default Re: Display Array Value based off 2nd array value?

    You don't need the pound signs around the session.firstarray[1][1]

    #SESSION.secondarray[SESSION.firstarray[1][1]][2]#
    should work fine (assuming that secondarray is a 2-dimensional array).

    If not, what error are you getting?

    Kronin555 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