Support

Account

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'