Re: Creating single row for multiple items.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Check if I understood you...
You have this array and want create a csv?

On Mon, Sep 1, 2008 at 5:04 AM, Tom Shaw <php.coder@xxxxxxxxx> wrote:

> My array looks very similar to this. I need to create a single row for the
> items that have the same order number for CSV export.  I'd prefer to do
> this
> PHP wise instead of SQL. But would appreciate any help I can get.
>
>
>
>
>
> $ar = array(
>
>   array(
>
>     "order_id" => "34",
>
>     "order_number" => "35Y345Y356YU3",
>
>     "order_name" => "Steinway Grand Piano #11",
>
>     "order_ordered_size" => "Grand",
>
>     "order_sales_price" => "78671.90",
>
>     "order_shipping_price" => "7.85",
>
>     "order_shipping_extra" => "0.06",
>
>   ),
>
>   array(
>
>     "order_id" => "35",
>
>     "order_number" => "35Y345Y356YU3",
>
>     "order_name" => "Bechstein",
>
>     "order_ordered_size" => "Grand",
>
>     "order_sales_price" => "11671.90",
>
>     "order_shipping_price" => "51.00",
>
>     "order_shipping_extra" => "450.00",
>
>   ),
>
>   array(
>
>     "order_id" => "36",
>
>     "order_number" => "35Y345Y356YU3",
>
>     "order_name" => "Bosendorfer",
>
>     "order_ordered_size" => "Grand",
>
>     "order_sales_price" => "11671.90",
>
>     "order_shipping_price" => "500.00",
>
>     "order_shipping_extra" => "450.00",
>
>   ),
>
>   array(
>
>     "order_id" => "37",
>
>     "order_number" => "78973467Y3Y36",
>
>     "order_name" => "Steinway Grand Piano #11",
>
>     "order_ordered_size" => "Grand",
>
>     "order_sales_price" => "78671.90",
>
>     "order_shipping_price" => "7.85",
>
>     "order_shipping_extra" => "0.06",
>
>   ),
>
>   array(
>
>     "order_id" => "38",
>
>     "order_number" => "78973467Y3Y36",
>
>     "order_name" => "Baldwin L Grand Piano #39",
>
>     "order_ordered_size" => "Grand",
>
>     "order_sales_price" => "11671.90",
>
>     "order_shipping_price" => "1.00",
>
>     "order_shipping_extra" => "450.00",
>
>   )
>
> );
>

-- 
Thanks for your attention,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux