sophielois1
Technical User
Hi,
I hope somebody can help. Im trying to pull the serialized arrays i have stored in my table, and get the values for each array and assign them to say something like
$array1 = unserialize($row['knowledge_1']);
$array2 = unserialize($row['knowledge_2']);
$array3 = unserialize($row['knowledge_3']);
$array4 = unserialize($row['knowledge_4']);
$array5 = unserialize($row['knowledge_5']);
etc
etc
this is what i have so far.unfortunately it is not working. It is outputting 'there was a problem'.
Can anybody help me please?
thanks
soph
I hope somebody can help. Im trying to pull the serialized arrays i have stored in my table, and get the values for each array and assign them to say something like
$array1 = unserialize($row['knowledge_1']);
$array2 = unserialize($row['knowledge_2']);
$array3 = unserialize($row['knowledge_3']);
$array4 = unserialize($row['knowledge_4']);
$array5 = unserialize($row['knowledge_5']);
etc
etc
this is what i have so far.unfortunately it is not working. It is outputting 'there was a problem'.
Code:
<?php
$sql = "SELECT knowledge_1 knowledge_2 knowledge_3 knowledge_4 knowledge_5 knowledge_6 knowledge_7 knowledge_8 knowledge_9 knowledge_10 knowledge_11 knowledge_12 knowledge_13 knowledge_14 FROM HS31 WHERE userid = $userid LIMIT 1";
if ($result = mysql_query($sql)) {
$row = mysql_fetch_assoc($result);
$array = array();
$array = unserialize($row['knowledge_1']);
print_r($array);
} else {
echo "there was a problem";
}
?>
Can anybody help me please?
thanks
soph