Re: [PHP-DB] Storing an array in the database

2003-02-28 Thread Chris Boget
> FYI: Make sure you addslashes() _after_ you serialize your array if it can > contain quotes. Everything else remains the same. Yeah, my bad. Good catch. Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Storing an array in the database

2003-02-28 Thread 1LT John W. Holmes
> > How would I store an array in the database? I want to store 2 things. > > One array of shirt sizes and one array of which holds other arrays. [snip] > $query = "INSERT INTO table > ( field1, field2 ) > VALUES > ( \"" . serialize( $singleDimA

Re: [PHP-DB] Storing an array in the database

2003-02-28 Thread 1LT John W. Holmes
> How would I store an array in the database? I want to store 2 things. > One array of shirt sizes and one array of which holds other arrays. $safe = addslashes(serialize($array)); and store $safe into a text column. Use $array = unserialize($database_data); to get the array back. ---John H

RE: [PHP-DB] Storing an array in the database

2003-02-28 Thread Jonathan Villa
To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Storing an array in the database > How would I store an array in the database? I want to store 2 things. > One array of shirt sizes and one array of which holds other arrays. Easy. $singleDimArray = array( 1, 2

Re: [PHP-DB] Storing an array in the database

2003-02-28 Thread Chris Boget
> How would I store an array in the database? I want to store 2 things. > One array of shirt sizes and one array of which holds other arrays. Easy. $singleDimArray = array( 1, 2, 3, 4, 5 ); $multiDimArray = array( array( "this" => "that", "here" => "there" ),

Re: [PHP-DB] Storing an array in the database

2003-02-28 Thread Ignatius Reilly
t me know! Ignatius - Original Message - From: "Jonathan Villa" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 5:09 PM Subject: [PHP-DB] Storing an array in the database > > How would I store an array in the database? I want to st

Re: [PHP-DB] Storing an array in the database

2003-02-28 Thread Terry Romine
just as a quick fix. I use the following snip to take an array of choices, enter it into a varchar field (or text if you expect alot) and extract back to array: $choicesArray is a list of checkboxes from a form // put data into table $checkList = implode(";", $choicesArray); mysql_query("upd

RE: [PHP-DB] Storing an array in the database

2003-02-28 Thread Hutchins, Richard
x27;m just lazy. ;^) HTH Rich > -Original Message- > From: Jonathan Villa [mailto:[EMAIL PROTECTED] > Sent: Friday, February 28, 2003 11:10 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Storing an array in the database > > > > How would I store an array in the

[PHP-DB] Storing an array in the database

2003-02-28 Thread Jonathan Villa
How would I store an array in the database? I want to store 2 things. One array of shirt sizes and one array of which holds other arrays. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php