Fw: [PHP] Array into database

2002-06-11 Thread Kevin Stone

Yes I believe serialize will work with any array.  When you extract it from
the database simply do $array = unserialize($str) to rebuild the array.
-Kevin

- Original Message -
From: "Leon Mergen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 11, 2002 3:59 PM
Subject: Re: [PHP] Array into database


> So this would handle 2-demensional arrays too?
>
> So, if I have
>
> $array = (
> "foo" => "bar",
> "wom" => "bat"
> );
>
>
> it would work?
>
> And darn, that I didn't come up with this (I'm familliar with Java, and
they
> use Serializable) ...
>
> "Stuart Dallas" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > On Tuesday, June 11, 2002 at 10:25:36 PM, you wrote:
> > > I would like to know wether it's possible to put an array into a
> database?
> > > If not, what is the best way to archieve something like that?
> >
> > Yes it is. See http://www.php.net/serialize
> >
> > --
> > Stuart
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Fw: [PHP] Array into database

2002-06-11 Thread Kevin Stone

Not directly no.   You can serialize the array and store it in a single text
field.  Or, if this array contrains data that you'll be retrieving often
then you can construct a table and store each array element in a new row.
-Kevin

- Original Message -
From: "Leon Mergen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 11, 2002 3:25 PM
Subject: [PHP] Array into database


> Hello,
>
> I would like to know wether it's possible to put an array into a database?
> If not, what is the best way to archieve something like that?
>
> Thanks in advance,
>
> Leon Mergen
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php