Home › Forums › General Issues › Update posts after altering checkbox option › Reply To: Update posts after altering checkbox option
Okay, I believe I solved it.
The stupid apple autocapitalize caused the i
to turn into capital I
when I wrote my mysql query, and thus the serialized string that had been replaced in the DB was actually:
a:1:{I:0;s:8:”Charcoal”;}
Unbelievable, it’s actually insane that sequelpro allows autocapitalization/autosuggestion in a query anywhere in its interface.
So in case anyone does need to do something like this, I believe the following process does indeed work:
1. Alter the choice as you normally would by editing the custom field
2. Perform the mysql query with the length of the strings for the serialization in mind in the s:X:
part of the query
UPDATE wp_postmeta
SET
meta_value = REPLACE(meta_value,
's:5:"Black"',
's:8:"Charcoal"')
WHERE
meta_key = 'colour'
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.