Transforming object properties?
- From: Mike <mpearl1@xxxxxxxxx>
- Date: Tue, 8 May 2012 16:44:48 -0700 (PDT)
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
.
- Follow-Ups:
- Re: Transforming object properties?
- From: M. Strobel
- Re: Transforming object properties?
- From: Jeff North
- Re: Transforming object properties?
- Prev by Date: Re: Windows binaries 64bit for PHP
- Next by Date: Re: Transforming object properties?
- Previous by thread: reading a newline from a properties file
- Next by thread: Re: Transforming object properties?
- Index(es):