Re: Possible to store arrays in mySQL without explode()/implode()

From: Date: Sat, 07 Jun 2003 15:05:08 +0000
Subject: Re: Possible to store arrays in mySQL without explode()/implode()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-150583@lists.php.net to get a copy of this message
----- Original Message ----- From: "Jakob Mund" <jakob_m@gmx.de> To: <php-db@lists.php.net> Sent: Saturday, June 07, 2003 9:04 AM Subject: [PHP-DB] Possible to store arrays in mySQL without explode()/implode() > is it possible to store an array in mySQL without using implode() / > explode(), like this: Serialize the array to make it a string and store that. Unserialize() to make it an array again. The column type you choose depends in the length of the values you might choose to put in the array. Serialize the array to a var and check it's length with strlen to get some ideas of what type you might need. http://www.php.net/serialize http://www.php.net/unserialize

« previous php.general (#150583) next »