I have a serialized code in db. At first I did the unserialize and after that I dont know how use the unserialized code to select other database. Anyone can help me?
mysql_connect('localhost','user','password') or die (mysql_error());
mysql_select_db('database') or die (mysql_error());
$query = "SELECT * FROM cscart_order_details";
$result = mysql_query($query) or die (mysql_error());
$num = mysql_numrows($result);
mysql_close($link);
for ($i = 0; $i < $num; $i++) {
$extra = mysql_result($result,$i,"extra");
$serializedData = $extra;
$data = @unserialize($serializedData);
print_r($data);
echo '<br>';
} [/COLOR]
And shows me this unserialized lines, example: the number 97 is option_id and 141 is a variant_id. The variant_id represents a variant_name in other table. How can I get this numbers to put into other query?
Array ( [product_options] => Array ( [97] => 141 ) [is_edp] => [base_price] => 0 )
Array ( [product_options] => Array ( [96] => 140 ) [is_edp] => [base_price] => 0 )
Array ( [product_options] => Array ( [81] => 108 ) [is_edp] => [base_price] => 0 )
Array ( [product_options] => Array ( [81] => 108 ) [is_edp] => [base_price] => 0 )
Array ( [product_options] => Array ( [95] => 139 ) [is_edp] => [base_price] => 0 )