Having some difficulty designing this program. Here's the specs:

1) Pull player info out of DB by position, and insert information into an array at each position. @QB, @RB, @WR, etc... I'm not sure how to store the information from the DB in an array? I assume the best way to do this is to put all the DB info in an array and iterate through the arrays so the program doesn't do 50 Billion calls to the DB. I'm guessing each record would have to be saved as a multidimensional array, because you have your player ID, which could represent the first dimension, and then you have a key and a value based on the record? So, I guess what I'm saying is if I have the following info:

player_id: 1
player_name: Jeff
player_salary: 5
What would that array look like to index it by it's id first, and then using the keys, player_name, set to value Jeff?

I can't figure out how to get the information from the database in a useable format WHILE keeping track of the important statistics. I don't just want max value, I want to know the variables that lead to the max value. TIA for any advice.

I love it when a program comes together - jdhannibal

In reply to Multidimensional Array Iteration? by jdlev

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.