I am creating code where i am updating a table where a json_encoded value return with this code
global $wpdb;
$table_name = $wpdb->prefix . 'ab_payments';
$test = '{"items":[{"ca_id":1,"appointment_date":"2016-11-04 08:00:00","service_name":"wordpress developer","service_price":"10.00","deposit":"100%","number_of_persons":"1","staff_name":"admin","extras":[]}],"coupon":{"code":"5off","discount":"50","deduction":"0.00"},"customer":"admin"}';
$wpdb->query($wpdb->prepare("UPDATE $table_name SET details='$test' WHERE id LIKE '$paymentid'"));
but the problem is its not updating database value. if replace value with simple text its working fine but with test json_encoded value is not updating please help.
thank you
thanks @tadman its wordpress placeholder which require to update json_encode code so updated code with this and start working.
$wpdb->query($wpdb->prepare("UPDATE $table_name SET details=%s WHERE id=%d",$serialized,$paymentid));