3 added 166 characters in body
source | link

You may need to unserialize the data to get the array and loop through it thus:

$userid = 832; // or 1540
$voter$votes = maybe_unserialize(get_post_meta($postid,'voter');
$votes = maybe_unserialize($votes); 

if (is_array($voter$votes)) {
    // votes is the array, key is numeric index, vote is subarray
    foreach ($voter$votes as $key => $vote) {
         // subarray values are in another array with key 'voter'
         if ($vote['voter']['voter_id'] == $userid) {
             $voter[$key]['voter']['vote']$votes[$key]['voter']['vote'] = $newvote;
             $voter[$key]['voter']['voter_ip']$votes[$key]['voter']['voter_ip'] = $newvoterip;
         }                 
    }
    update_post_meta($postid,'voter',$voter);
}

You may need to unserialize the data to get the array and loop through it thus:

$userid = 832; // or 1540
$voter = maybe_unserialize(get_post_meta($postid,'voter'));
if (is_array($voter)) {
    foreach ($voter as $key => $vote) {
         if ($vote['voter']['voter_id'] == $userid) {
             $voter[$key]['voter']['vote'] = $newvote;
             $voter[$key]['voter']['voter_ip'] = $newvoterip;
         }                 
    }
    update_post_meta($postid,'voter',$voter);
}

You may need to unserialize the data to get the array and loop through it thus:

$userid = 832; // or 1540
$votes = get_post_meta($postid,'voter');
$votes = maybe_unserialize($votes); 

if (is_array($votes)) {
    // votes is the array, key is numeric index, vote is subarray
    foreach ($votes as $key => $vote) {
         // subarray values are in another array with key 'voter'
         if ($vote['voter']['voter_id'] == $userid) {
             $votes[$key]['voter']['vote'] = $newvote;
             $votes[$key]['voter']['voter_ip'] = $newvoterip;
         }                 
    }
    update_post_meta($postid,'voter',$voter);
}
2 added 27 characters in body
source | link

You may need to unserialize the data to get the array and loop through it thus:

$userid = 832; // or 1540
$voter = maybe_unserialize(get_post_meta($postid,'voter'));
if (is_array($voter)) {
    foreach ($voter as $key => $vote) {
         if ($vote['voter_id']$vote['voter']['voter_id'] == $userid) {
             $voter[$key]['vote']$voter[$key]['voter']['vote'] = $newvote;
             $voter[$key]['voter_ip']$voter[$key]['voter']['voter_ip'] = $newvoterip;
         }                 
    }
    update_post_meta($postid,'voter',$voter);
}

You may need to unserialize the data to get the array and loop through it thus:

$userid = 832; // or 1540
$voter = maybe_unserialize(get_post_meta($postid,'voter'));
if (is_array($voter)) {
    foreach ($voter as $key => $vote) {
         if ($vote['voter_id'] == $userid) {
             $voter[$key]['vote'] = $newvote;
             $voter[$key]['voter_ip'] = $newvoterip;
         }                 
    }
    update_post_meta($postid,'voter',$voter);
}

You may need to unserialize the data to get the array and loop through it thus:

$userid = 832; // or 1540
$voter = maybe_unserialize(get_post_meta($postid,'voter'));
if (is_array($voter)) {
    foreach ($voter as $key => $vote) {
         if ($vote['voter']['voter_id'] == $userid) {
             $voter[$key]['voter']['vote'] = $newvote;
             $voter[$key]['voter']['voter_ip'] = $newvoterip;
         }                 
    }
    update_post_meta($postid,'voter',$voter);
}
1
source | link

You may need to unserialize the data to get the array and loop through it thus:

$userid = 832; // or 1540
$voter = maybe_unserialize(get_post_meta($postid,'voter'));
if (is_array($voter)) {
    foreach ($voter as $key => $vote) {
         if ($vote['voter_id'] == $userid) {
             $voter[$key]['vote'] = $newvote;
             $voter[$key]['voter_ip'] = $newvoterip;
         }                 
    }
    update_post_meta($postid,'voter',$voter);
}