Unfortunately I have to change and meddle with dates and times, so I can't.

Siggy

Format:

The code is basically:

$everything [ $date ] = array(10, 20, 30, 40);

where $date is simply a text string like "01/01/2001";

Eg:

array(4) {
  ["07/01/2002"]=> array(3) {
    [6]=> int(7200)
    [5]=> int(17400)
    [1]=> int(22500)
  }
  ["14/01/2002"]=> array(4) {
    [1]=> int(77400)
    [4]=> int(83700)
    [5]=> int(77400)
    [6]=> int(144300)
  }
  ["21/01/2002"]=> array(4) {
    [1]=> int(63900)
    [4]=> int(81900)
    [5]=> int(105000)
    [6]=> int(92400)
  }
  ["23/01/2002"]=> array(4) {
    [1]=> int(35100)
    [4]=> int(18000)
    [5]=> int(38100)
    [6]=> int(55500)
  }
}

Siggy



"David Robley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> [EMAIL PROTECTED] (Siggy) wrote in
> news:[EMAIL PROTECTED]:
>
> > Yeah, sorry, was posting late at night :P
> >
> > I am getting time-durations from a database, aggregating them per week
> > (with a few conditions), so that I go from data like this:
> >
> > 2001-10-01,  4:30,  2        (ie, "person 2" did a "4 hour, 30 min"
> > peice of work on a certain date).
> >
> > to this:
> >
> > date = hours work by person1,  person2,  person3, person4 ....
> > 2001-01-01 = 23, 45, 12, 45, 02, as in:
> >
> > The reason i'm doing it in this way, is because I need to do a bit of
> > shifting around of hours when people worked over midnight etc.
> >
> > Anyway, when I get to the end;
> > 2001-01-01 = 23, 45, 12, 45, 02
> > 2001-01-08 = 3, 15, 2, 35, 8
> >
> > etc etc ... I want to see the total (and the average, but thats easy)
> > hours worked by each person.
> >
> > Siggy
> >
> > PS: Hey there New Zealander, hope you're in Wellington enjoying the
> > positively fantastic weather  :P
>
> Nah, I'm in Auckland enjoying the weather without the wind :-) But only a
> temporary Kiwi - Aussie underneath. Don't mention the cricket, OK?
>
> From the looks of things, you should be able to use some sort of summing
> and grouping, maybe a multiple query to pull the finished data out of your
> DB, rather than struggling with multidimensional arrays?
>
> --
> David Robley
> Temporary Kiwi!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to