Wednesday, December 29, 2021

[FIXED] Add +15 additional days to several dates en masse in mysql PHPmyadmin?

Issue

Hello I hope you can help me, I know I can do it manually but there are more than 200 users. I have these expiration dates to which I need to add an additional +15 days. How could I do it in bulk in mysql PHPmyadmin?

The data is in the table: wp_usermeta

wp_usermeta


Solution

Since meta_value is a longtext, you can convert it to date and format it back afterwards.

UPDATE wp_usermeta SET meta_value = date_format(date_add(str_to_date(meta_value,'%Y-%m-%d'),interval 15 day), '%Y-%m-%d') WHERE meta_key = 'user_payment_expired_date';


Answered By - Alaister

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.