This is my first time here, and I am pulling my hair out because of this, so I thought it would be a good first question for me.
I save the array data in a mysql database, and then later use unserialize to edit it. The problem is that it processes every other index in the array when I edit only one index. Here is a sample code:
foreach($post as $key => $value) {
if (isset($row)) {
if ($i > 2) { $tempArray = unserialize($row[$i]); }
}
$tempArray[$time] = $value;
if ($key == 'pid' || $key == 'uid') { $data[$key] = $value; }
else { $data[$key] = serialize($tempArray); }
$i += 1;
unset($tempArray);
}
Thanks for any insight you can give.
source
share