[PHP] saving and retrieving an array from a database

2006-08-07 Thread Ross
Hi, I have an array of values. I want to save them with php to a single field in my database and then retrieve them to an array. What is the simplest way to achive this? Ross -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] saving and retrieving an array from a database

2006-08-07 Thread Jim Moseby
Hi, I have an array of values. I want to save them with php to a single field in my database and then retrieve them to an array. What is the simplest way to achive this? http://us3.php.net/serialize Cheers! JM -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] saving and retrieving an array from a database

2006-08-07 Thread ross
ok this seem to work but how do I bring it back? This is what I have so far. ? $first[] = array('appple', 'pear', 'banana'); $second = serialize($first); $third[]= unserialize($second); echo $second; //outputs serialized data echo $third[1]; ? - Original Message - From: Peter Lauri

Re: [PHP] saving and retrieving an array from a database

2006-08-07 Thread Andrei
Well it seems like u made a mess there with arrays... ? $first[] = array('appple', 'pear', 'banana'); $second = serialize($first); $third[]= unserialize($second); echo $second; //outputs serialized data echo $third[1]; ? From definition of first I understand it's an array of arrays with

RE: [PHP] saving and retrieving an array from a database

2006-08-07 Thread Peter Lauri
http://se2.php.net/serialize /Peter -Original Message- From: Ross [mailto:[EMAIL PROTECTED] Sent: Monday, August 07, 2006 7:19 PM To: php-general@lists.php.net Subject: [PHP] saving and retrieving an array from a database Hi, I have an array of values. I want to save them with php to

Re: [PHP] saving and retrieving an array from a database

2006-08-07 Thread Richard Lynch
On Mon, August 7, 2006 7:52 am, [EMAIL PROTECTED] wrote: ok this seem to work but how do I bring it back? This is what I have so far. ? $first[] = array('appple', 'pear', 'banana'); $second = serialize($first); Store $second in the DB here. It's just a big long-ass string at this point.