Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

when import data, the widget text is missing, and i find the problem is the serialize string is wrong, so i try to fix that string.

    $fixed = fixString($string);

    $wpdb->update(
       'wp_options',
       array('option_value' => $fixed ),
       array('option_id'    => 80) // Id of widget_text option
    );

I try the above update query, but it does not work. But it works with

 update_option('widget_text', unserialize($fixed ));

So what is wrong ? I need to check and fix all the serialize string in database, so i need to use run sql query

share|improve this question
    
Can you please explain whats this does fixString($string)? –  Chittaranjan Jun 10 at 5:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.