good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Reading data from mySQL into hashes and manipulation of hashesby lagrenouille (Acolyte) |
on Aug 30, 2002 at 11:39 UTC ( [id://194072]=perlquestion: print w/replies, xml ) | Need Help?? |
lagrenouille has asked for the wisdom of the Perl Monks concerning the following question:
G'day all
What I need to do: 1. Extract some values from a mySQL database and store them in an associate array. This is how I have been doing it, and it works... however I'm sure there is a more efficient method of doing it... I just can't nut it out. Any suggestions ? 2. Then I need to calculate the total of the votes entered and then calculate these in percentages using the total (stored in $row[11] -> $row[16]) I don't think this is working... It is also very ugly and innefficient as with the first part of my question. Could anyone explain why it isn't working ? (the values are not being given data to store... uninitialised) 3. I then need to sort the associate array using the percentage as the item to sort by, so that the highest percentage is the first item in the associate array. This I have little or no idea about... so any comments suggestions most appreciated. Thanks in advance lagrenouille Edit: Added <code> tags. larsen
Back to
Seekers of Perl Wisdom
|
|