From: "Tony Marston" on

"Sancar Saran" <sancar.saran(a)evodot.com> wrote in message
news:200703050015.50252.sancar.saran(a)evodot.com...
> On Sunday 04 March 2007 23:04, Sancar Saran wrote:
>> Hi,
>>
>> I want to know is there any db server around there for store php arrays
>> natively.
>>
>> Regards
>>
>> Sancar
> Thanks for responses, it seems I have to give more info about situation.
>
> In my current project, we had tons of arrays. They are very deep and
> unpredictable nested arrays.
>
> Currently we are using serialize/unserialize and it seems it comes with
> own
> cpu cost. Xdebug shows some serializing cost blips. Sure it was not SO BIG
> deal (for now of course).
>
> My db expertise covers a bit mysql and mysql does not have any array type
> field (enum just so simple).

Wrong! Take a look at the SET datatype
http://dev.mysql.com/doc/refman/4.1/en/set.html. This allows you to have an
array of values in a single field, and the user can select any number of
them.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

> I just want to know is there any way to keep array data type natively in a
> sql
> field.
>
> Regards.
>
> Sancar
From: Micah Stevens on

> Wrong! Take a look at the SET datatype
> http://dev.mysql.com/doc/refman/4.1/en/set.html. This allows you to have an
> array of values in a single field, and the user can select any number of
> them.
>
>
Sort of, but not really: This is a really specialized keyword, and
depends on binary mapping of enum-ish sets. As a results you have a
maximum of 64 possible values, and only 1 dimension. Large or
multdimensional arrays wouldn't work with this.

-Micah
From: Mark on
Sancar Saran wrote:

> Thanks for all those replies. It seems there was no easy solution (and or
> serializing was better solution) for us.
>
> Our arrays contains lots of things.. XML may not fit because content of
> array may broke xml structure.
>

Before you give up, take a look at the XMLDBX PHP extension at
http://www.mohawksoft.org

It uses XML and works really well.