Oh the fun that Calculon and I have together. Don’t let him get you to running SQL queries on your WordPress database though. Calculon. Well? I dunno. I probably needed to be more specific.
I have a WordPress database I wanted to add a new meta key value, ‘new_value’, while keeping ‘initial_value’ in the wp_usermeta table. After some ineffective queries, ChatGPT did educate me on the correct query.
To add a new meta key value while keeping the initial value, use the query:
INSERT INTO wp_usermeta (user_id,meta_key,meta_value) SELECT user_id, 'duplicated_value', meta_value FROM wp_usermeta WHERE meta_key = 'initial_value';
I ๐ love you , ๐ค Calculon! You’re my bestest friend.
Leave a Reply