I have a simple script that queries db and puts results in am array with commas between each element. Works great. What I want to do with this is UPDATE each row that this array was made from by INSERT the array output in another empty field in the same row that the array was made from. It seems to only write the array output from the last row to this field.
pic1, pic2, pic3, pic4, pic5 - makes array called $picarray which is imploded with commas to array called $output
$query = "SELECT * FROM test1";
$result = mysql_db_query ($DBName, $query, $Link);
$total = mysql_num_rows($result);
while($row = mysql_fetch_assoc($result)) {
$picarray = array("$row[pic1]","$row[pic2]","$row[pic3]","$row[pic4]","$row[pic5]");
$output = implode(',', array_filter($picarray));
//Here is what I am unsure of how to do. Wants to overwrite each time
$query1 = "UPDATE test1 SET pics1 = '$output';";
$result1 = mysql_db_query ($DBName, $query1, $Link);
}