Hello -
Can I insert an array into a database field, then get it back out again later? Id like the database field to contain the array of variables, then id like to be able to echo the variables in a field onto a page...
ie
$products = array (
"products" => array(
"itemcode" => "$itemcode",
"handle" => "$handle",
"color" => "$color",
"swing" => "$swing",
"backset" => "$backset",
"doorthickness" => "$doorthickness",
"radius" => "$radius",
"options" => "$options"
),);
$sql = "INSERT INTO USERS SET ITEM1 ='$products'";
$query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());
To finally get at it like :
$SQL = "SELECT * from USERS";
$result = mysql_query( $SQL );
while( $row = mysql_fetch_array( $result ) ) {
$item1 = $row["ITEM1"];
$products = array ($item1);
print_r ($products[$itemcode]);
}
Thanks a bunch!