Update value inside array update_post_meta

The structure of the array you’ve provided suggests that you’re trying to access an incorrect level of the array. Try to replace: $t[0][“_give_amount”] = 25.00; $t[1][“_give_amount”] = 65.00; $t[2][“_give_amount”] = 100.00; $t[3][“_give_amount”] = 250.00; $t[4][“_give_amount”] = 650.00; with: $t[0][0][“_give_amount”] = 25.00; $t[0][1][“_give_amount”] = 65.00; $t[0][2][“_give_amount”] = 100.00; $t[0][3][“_give_amount”] = 250.00; $t[0][4][“_give_amount”] = 650.00;

Add custom fields from different posts

<?php $totalprice_posts = get_posts(‘post_type=items&author=”.$thisauthorID.”&tag=’.$thispostID.’&numberposts=-1′); $totalprice_array = array(); foreach ($totalprice_posts as $post) { $productprice = get_post_meta($post->ID, “productprice”, true); $productquantity = get_post_meta($post->ID, “productquantity”, true); $totalproductprice = ($productprice * $productquantity); array_push($totalprice_array, $totalproductprice); } echo implode(‘,’, $totalprice_array); echo array_sum($totalprice_array); ?

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)