Transforming object properties?



I need an array of objects that looks like this:

$items[$i]->name
->new_amount
->old_amount

The data would look like this:

name new_amount old_amount
John 500.00 200.00
Sue 15.00 <NULL>
Frank 254.00 <NULL>
Max <NULL> 28.00The data would look like this:

But the results of my sql query comes back as:

$items[$i]->name
->type
->amount

name type amount
----------------------------------
John new_amount 500.00
John old_amount 200.00
Sue new_amount 15.00
Frank new_amount 254.00
Max old_amount 28.00

Is there a reasonable way to accomplish this?

Thanks!

Mike
.