I cannot update a wp_postmeta field called ‘alive_days’ and making its value equal to zero, in wordpress. I have tried all the two following solutions but still not working:
- $alive_days=’alive_days’;$mypostid=$_REQUEST[‘pid’];
- global $wpdb;
- $wpdb->query(“update
$wpdb->wp_postmeta set meta_value==”$ziro” where
post_id=”$mypostid” and meta_key=”$alive_days””);
- $ziro=0;
- $mypostid=$_REQUEST[‘pid’];
- update_post_meta($mypostid, ‘alive_days’,$ziro);
The field value will not change after the execution.
try with this code