View Single Post
Old 06-02-2008, 02:26 PM   #1 (permalink)
Dave
The Acquainted
 
Dave's Avatar
 
Join Date: Apr 2008
Posts: 110
Thanks: 97
Dave is on a distinguished road
Default Assigning variables and their values from ARRAYS

I have the following array from a mysql_query():

Array ( [0] => 1 [1] => 4 )
Array ( [0] => 2 [1] => 19 )
Array ( [0] => 4 [1] => 18 )
Array ( [0] => 5 [1] => 5 )
Array ( [0] => 6 [1] => 7 )
Array ( [0] => 7 [1] => 19 )
Array ( [0] => 9 [1] => 6 )


Numbers 1 - 9 represent math instructional units, and numbers 4, 19, 2, etc., represent the number of test items within each unit.

Note that there are no units for 3 and 8.

From the array, I want to derive a group of variables (units) and assign them to the number of items in each group. Example:

$mUnit1 = 4
$mUnit2 = 19
$mUnit4 = 18
.....etc.

I've tried and tried...and tried...but I don't have the chops to do this. (At the rate I'm going, I will by 2012.) Any help would be appreciated!

Dave
Dave is offline  
Reply With Quote