Re: Storing a php variable in MySQL

From: Date: Wed, 25 Feb 2004 23:32:17 +0000
Subject: Re: Storing a php variable in MySQL
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-33132@lists.php.net to get a copy of this message
Daniel Crespo wrote:
Hi there. I want to save a variable (its structure and data) in MySQL. I know the function "serialize(mixed value)", wich generates a storable representation of a value. This storable representation has characters like "{" and ":" (when talking about arrays). So, how can I store this in MySQL? Wich type of field do I have to create in de DB? I tried the "longtext" type, but it doesn't work. Any help? Thanks.
How did it not work? If there was an SQL error, you may want to run addslashes() on the serialized data befre storing it. -- paperCrane <Justin Patrin>

« previous php.db (#33132) next »