Store array in db
Posted: Fri Sep 24, 2004 10:27 pm
Is there anyway to store this in a mysql table such that when retrieving it in mysql_fetch_assoc() I should be able to use the result as an array
Code: Select all
$array=array(
array("Key1"=>"Value1","Key2"=>"Value06","Key3"=>"Value11"),
array("Key1"=>"Value2","Key2"=>"Value07","Key3"=>"Value12"),
array("Key1"=>"Value3","Key2"=>"Value08","Key3"=>"Value13"),
array("Key1"=>"Value4","Key2"=>"Value09","Key3"=>"Value14"),
array("Key1"=>"Value5","Key2"=>"Value10","Key3"=>"Value15")
);Code: Select all
$row=mysql_fetch_assoc($res);
$arr=$row['array']
echo $arr[2]['Key2'];