RE: array - too stupid
| From: | Tim Ward | Date: | Mon, 19 Feb 2001 09:44:14 +0000 |
| Subject: | RE: array - too stupid | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-40550@lists.php.net to get a copy of this message | ||
sorry about the first empty reply ...
the correct sql solution is that anything stored in an array in your program
should be a separate table in your database.
e.g
table order:
->order_num (primary key)
->customer
->date
-> ...
table item:
->order_num
->item_num
->quantity
-> ...
foreign key order_num reference order
Tim Ward
Senior Systems Engineer
Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html
> -----Original Message-----
> From: andreas (@work) [mailto:myviva@utanet.at]
> Sent: 18 February 2001 20:27
> To: php-general@lists.php.net
> Subject: array - too stupid
>
>
> hi,
>
> how can i store an array in mysql ?
>
>
> what i do now ( works fine )
> ========================
>
>
> a) transform the array to a § delimeted string
> // $tempItem is a § dlimited string example:
> 4321§117§A123§42WQ§1243
> b) $tempItem = serialize($tempItem);
>
> c) store it in mysql-table
>
>
>
> and i get my array back with
>
>
> d) $myItems = explode("§",unserialize($myValueFromDB));
>
>
>
> but i think theres an easier way out there
> any solutions
>
>
> greetings
>
> andreas
>
>