Re: [PHP-DB] Storing an array on a table?

2005-09-02 Thread Fen Lu
Now you got tow ways. serialize or convernt to a string~ I think string is better~ maybe I'm getting old~ don't like new things like serialize...;-) On 9/1/05, Miguel Guirao <[EMAIL PROTECTED]> wrote: > > > > Hi!! > > I want to store an array into a field on a MySQL table, Is it posible to >

Re: [PHP-DB] Storing an array on a table?

2005-09-01 Thread tg-php
Ahh..thanks Jordan.. sorry I missed that one and thanks for the info. I assumed serialize was just magic and worked properly. hah. Now I know. I always thought it was sloppy to use anyway, but in a pinch, it's nice to know there's an option like that. Imploding does sound better though. -T

RE: [PHP-DB] Storing an array on a table?

2005-09-01 Thread Miguel Guirao
PROTECTED] Cc: php-db@lists.php.net Subject: Re: [PHP-DB] Storing an array on a table? Yes, this has been mentioned in this thread. But with serialize/ unserialize, you can run into other problems that may be more confusing/difficult to troubleshoot. e.g.: http://www.php.net/serialize > >As y

Re: [PHP-DB] Storing an array on a table?

2005-09-01 Thread Jordan Miller
Yes, this has been mentioned in this thread. But with serialize/ unserialize, you can run into other problems that may be more confusing/difficult to troubleshoot. e.g.: http://www.php.net/serialize >As you can see, the original array : >$arr["20041001103319"] = "test" > >after serialize/uns

Re: [PHP-DB] Storing an array on a table?

2005-09-01 Thread tg-php
Sorry, didn't catch this thread from the beginning, but did anyone recommend trying the serialize() and unserialize() commands? They'll convert the array to a block of text that can be stored, retrieved and unserialized. My gut instinct is that if you're trying to store any array in a database,

Re: [PHP-DB] Storing an array on a table?

2005-09-01 Thread Jordan Miller
if you just have a simple array with automatic numeric keys and text you could just implode the data to a string with a separator not found in your data: $dataArray = array("hello", "goodbye", "etc."); $storable = implode("", $dataArray); // $storable becomes "hellogoodbyeetc." //

RE: [PHP-DB] Storing an array on a table?

2005-09-01 Thread Bastien Koert
yes, check out the serialize and unserialize fuinctions in the manual (www.php.net/serialize) bastien From: Miguel Guirao <[EMAIL PROTECTED]> To: php-db@lists.php.net Subject: [PHP-DB] Storing an array on a table? Date: Thu, 01 Sep 2005 08:55:24 -0500 Hi!! I want to store an array into a