|We don't bite newbies here... much|
How to add MySql Records To Array or Hash?by jdlev (Scribe)
|on Sep 09, 2013 at 17:30 UTC||Need Help??|
jdlev has asked for the
wisdom of the Perl Monks concerning the following question:
I still continue to struggle with this stuff. I just can't seem to form an array based on a mysql query using perl. I was hoping someone could show me a working example. My first question is should I use an array or a hash to store the data? Here is what I'm trying to do:
I was hoping someone could break this down for me in steps:
Step 1: Get salary data & insert into an array/hash based on player ID as key, and player salary as value.
So the array/hash for @QBsalary would simply be represented as [12345 => 15,000, 54321=>14,500]
Step 2: Get the points data & insert into an array/hash based on player ID as key, and player points as value.
So the array/hash for @QBpoints would simply be represented as [12345 => 20, 54321=>19]
Step 3: How would I iterate through every QB pulling in both their salary & points? This is very confusing to me. Thanks for any help!
I love it when a program comes together - jdhannibal