For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > August 2004 > Array









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Array
Miguel Guirao

2004-08-26, 8:56 pm

Hi!!

I have a table with many options from when the user can select them,
after that, his/her selections will be stored in a database.

In the mean time, I want to store his/her selections in an array like
this one:

PN Desc Qty
|-----------------------|----------------------|-----------------------|
|-----------------------|----------------------|-----------------------|
|-----------------------|----------------------|-----------------------|

How do I declare Duch an array like this??, let's call it Parts.


Miguel Guirao
Servicios Datacard
www.SIASA.com.mx
Torsten Roehr

2004-08-26, 8:56 pm

"Miguel Guirao" <mguirao@acrosoft.net> wrote in message
news:001701c48bb1$43d01880$0500a8c0@serv
idor.net...
> Hi!!
>
> I have a table with many options from when the user can select them,
> after that, his/her selections will be stored in a database.
>
> In the mean time, I want to store his/her selections in an array like
> this one:
>
> PN Desc Qty
> |-----------------------|----------------------|-----------------------|
> |-----------------------|----------------------|-----------------------|
> |-----------------------|----------------------|-----------------------|
>
> How do I declare Duch an array like this??, let's call it Parts.
>
>
> Miguel Guirao
> Servicios Datacard
> www.SIASA.com.mx


Hi,

do you mean this:

$parts = array(array('PN' => $PN_value1, 'Desc' => $Desc_value1, 'Qty' =>
$Qty_value1),
array('PN' => $PN_value2, 'Desc' => $Desc_value2, 'Qty' =>
$Qty_value2),
array('PN' => $PN_value3, 'Desc' => $Desc_value3, 'Qty' =>
$Qty_value3)
);

Regards, Torsten Roehr
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com