unserialise() How do i use it?

Hey all, Complete Newbie.

I am trying to pull information from a DB,
I have done the query and I get the results I need, BUT I need to implement the unserialise()

And I have no idea how, Can someone please help.

[php]MySQL Table Viewer

<?php $db_host = 'localhost'; $db_user = '****'; $db_pwd = '*****'; $database = '****'; $table = 'ibf_nexus_purchases'; if (!mysql_connect($db_host, $db_user, $db_pwd)) die("Can't connect to database"); if (!mysql_select_db($database)) die("Can't select database"); // sending query $result = mysql_query("Select ps_id, ps_name,ps_member,ps_custom_fields from ibf_nexus_purchases where ps_name like 'Fiesta' OR ps_name like 'Ford'"); if (!$result) { die("Query to show fields from table failed"); } $fields_num = mysql_num_fields($result); echo "

Table: {$table}

"; echo ""; // printing table headers for($i=0; $i<$fields_num; $i++) { $field = mysql_fetch_field($result); echo ""; } echo "\n"; // printing table rows while($row = mysql_fetch_row($result)) { echo ""; // $row is array... foreach( .. ) puts every element // of $row to $cell variable foreach($row as $cell) echo ""; echo "\n"; } mysql_free_result($result); ?> [/php]
{$field->name}
$cell

The unserialize() function usually applied to the string that contain previously serialized array.
Here is how you use it:
[php]$arr = unserialize($cell);
var_dump($arr);[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service