Hi,
Hope that this helps (Just change the variables to your own needs):
(...)
//This lists the array values and converts the array values in php variables
list($storeID1,$storeID2,$storeID3,$storeID4,$storeID5)=$emprs;
(...)
//Assigns the value to the array
$stores[5]="$storeID";
//Prepares the array to be updated as a variable
$stores=implode($stores, ",");
$query="UPDATE tablename SET store='$stores' WHERE userID='$userID'; (...)