For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > August 2004 > Re: [PHP-DB] 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 Re: [PHP-DB] Array
Micah Stevens

2004-08-26, 8:56 pm

Since you provided no value's it's a little tough, but the general for would
be:

$parts = array(
array("PN" => $row1col1, "Desc" => $row1col2, "Qty" => $row1col3),
array("PN" => $row2col1, "Desc" => $row2col2, "Qty" => $row2col3)
);

Depending on your implimentation, it maybe easier to use some sort of loop to
assign things. If you wanted the array to be persistant across pages, you'd
want to user instead of $parts, $_SESSION['parts']. (assuming of course you
have initialized a session)

I personally would skip the array stuff and just pop it in a database.
-Micah

On Thursday 26 August 2004 02:11 pm, 'Miguel Guirao' wrote:
> 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

Sponsored Links







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

Copyright 2008 codecomments.com