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:[EMAIL PROTECTED]]
> Sent: 18 February 2001 20:27
> To: [EMAIL PROTECTED]
> 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
> 
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to