$array = array('1','2','3','4','5','6','10','100');
$array2 = serialize($array);
if($stmt->prepare("UPDATE `users` SET `dungeon_list` = ? WHERE name = ?")) { $stmt->bind_param('bs',$array2,$user['name']); $stmt->execute(); }
This is what I’ve learned to use on how to store arrays into mysql.
echo unserialize($user['dungeon_list']);
And this is how I output it. It says
Notice: unserialize() [function.unserialize]: Error at offset 0 of 140 bytes in C:\wamp\www\index.php on line 12
Dungeon_list is stored as a blob because that what I’ve learned to use to store it. Thank you!
Try to encode and decode your array before serialize and unserialize because if it has any “, ‘, :, or ; in any of the array values the serialization gets corrupted.