assignment of data into a 2 dimensional array

From: Date: Mon, 03 May 2004 17:42:02 +0000
Subject: assignment of data into a 2 dimensional array
Groups: php.general 
Request: Send a blank email to php-general+get-185216@lists.php.net to get a copy of this message
Hi, I have a database I am querying the date, and a set of numbers associated with each date. For example I may query a range of dates, for my exmaple I will use 04-20-2004 with the numbers 4,5,6,5,7,4 and the date 4-21-2004 with the numbers 1,2,5,1,2. There really is no pattern to the numbers, I'm just using some random numbers and dates. Anyway, I need to create a 2 dimensional array, where the 1st dimension contains the dates, and the discrete numbers in the 2nd dimension. so for example array[0][x] would contain the date of 04-20-2004 with 4,5,6,7 and array[1][x] would contain 4-21-2004 and 1,2,5. Then I would need to loop through the array and print the dates and the total count of the discrete numbers. How would I do the date/number assignment and then handle the printing of the dates and numbers from the array? the range of dates and numbers is always changing, so I need some sort of loop that can handle an ever changing amount of selected dates and numbers. thanks

« previous php.general (#185216) next »