update $wpdb one query – WordPress Development Stack Exchange
Is there a way to change mysql directly in wordpress just 1 operation without needing 2 operations: query and update?
I am facing problem of multiple concurrent transactions impacting point_user
I found the solution here, however I don’t know how to implement it on wordpress
Demo query sql
UPDATE wp_postmeta SET meta_value = meta_value - 1 WHERE post_id = 9999 AND meta_key = 'point_user'
Is there a way to update it like this?
global $wpdb; $wpdb->query($wpdb->prepare("UPDATE wp_postmeta SET meta_value = meta_value - 1 WHERE post_id= 9999 AND meta_key = 'point_user'"));
I’m stuck, many thanks for your support