RE: [PHP] Store array into mysql?

From: Date: Thu, 14 Feb 2002 19:29:04 +0000
Subject: RE: [PHP] Store array into mysql?
Groups: php.general 
Request: Send a blank email to php-general+get-84802@lists.php.net to get a copy of this message
$ser_array = serialize($myarray); then store $ser_array to a table as BLOB, TEXT, or even VARCHAR to use its contents, read it from the table and use unserialize() -----Original Message----- From: Jan Grafström [mailto:jan@grafstrom.net] Sent: Thursday, February 14, 2002 10:35 AM To: php-general@lists.php.net Subject: [PHP] Store array into mysql? Hi! I have an array called $myarray and now I want to store it in a mysql table. I tried to just, insert into mytable values('$id', '$myarray') but just got Array when I run while ($row = mysql_fetch_array ($result)) $myarray= $row[myarray]; echo $myarray -- Do I need to first make a string commaseparated or like and than insert that string? Thanks in advance. Regards, Jan Grafström -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#84802) next »