Re: assignment of data into a 2 dimensional array

From: Date: Mon, 03 May 2004 18:29:40 +0000
Subject: Re: assignment of data into a 2 dimensional array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-185224@lists.php.net to get a copy of this message
"Adam Williams" <awilliam@mdah.state.ms.us> wrote in message news:Pine.LNX.4.44.0405031234450.790-100000@roark.mdah.state.ms.us... > 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 Could you post a dump of the array or an example of how would like it to look like. I'm not quite sure how 04-20-2004 with 4,5,6,7 is supposed to fit in array[0][x]? Regards, Torsten

« previous php.general (#185224) next »