Archived

This topic is now archived and is closed to further replies.

  • 0

Update wp_options

Question

Posted · Report post

Hi

 

I'm using Iblogpro4. What I need is to update some contents in the feature sildes and feature boxes.

I would like to apply these changes directly from the database

In the table named 'wp_options', we select option_name = pagelines_option & pagelines_options_redundant and we can get the values to update

 

unfortunately after my update query I lose the updated values and fall on the basic configuration.

What I forget to do to get  the expected result ?
 
Thx in advance
 

 

Share this post


Link to post
Share on other sites

14 answers to this question

Posted · Report post

I'm afraid I'm not quite sure what the answer would be for this. Why do you need to update options in the database itself?

Share this post


Link to post
Share on other sites

Posted · Report post

If I understand correctly, you're wanting to update in the database directly because using the control panel in PageLines "restore features to default."  Unfortunately you cannot update in the database (as Simon stated above) because the data is serialized.

 

The more important thing to tackle would be to see why your features are reverting to default after you make a change. Could you disable ALL plugins (wordpress -> plugins) and then try to make the change in features?

Share this post


Link to post
Share on other sites

Posted · Report post

Hi catrina

 

Hope to be clear, my question is simple

 

1/ in the feature setting from the panel, you create a new slide or a new box and name the title 'Hello from Paris'. You save your change 

 

2/ in the 'wp_options' table from your DB you can get the following record :

 

O:7:"Options":73:{s:8:"features";a:5:{i:1;a:8:{s:5:"title";s:73:"<h1 class="ftitle">Hello from Paris</h1>"...

 

What I need to do by query is to change "Hello from Paris" by "Hello from LA"

 

When I run my query it restore features to default. :-(

 

What s Happen ?

Share this post


Link to post
Share on other sites

Posted · Report post

You can't edit a serialised array.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

Unfortunately, we really cannot support modification of the database for the reasons Simon said. Whatever you're trying to ultimately achieve is most likely already available via PageLines Framework. I'd strongly recommend upgrading because when WP updates next it's going to do two things: 1.  likely make your theme dysfunctional; and 2. overwrite any changes to your database or result in corruption of the database, leaving you without a site.

Share this post


Link to post
Share on other sites

Posted · Report post

could you develop a little bit more your answer ?

Is there any other solution to supply some info from a form directly to the DB (see above) ?

If else I should have to select an another theme

Thx

Share this post


Link to post
Share on other sites

Posted · Report post

I'm unclear what you're trying to do, but because iBlogPro4 is a deprecated product, it's very difficult for us to guide you about database changes.

 

You mentioned your update.  Do you mean updating WordPress or applying custom database changes?

Share this post


Link to post
Share on other sites

Posted · Report post

Thx Jenny,

I m going to test this but I don t understand why I ve to disable the plugins before...

I would like to understand what it happen when I select "save setup" button from "iBlogPro Feature Setup" page ?

I would like to do the same action but directly to the DB from update queries, the issue when I do that is that it restore the default information set up

How do we get around the issue of serialised array ?

Thx

Share this post


Link to post
Share on other sites

Posted · Report post

This is how serialized arrays work...

 

{s:5:"title";s:73:"<h1 class="ftitle">Hello from Paris</h1>

 

two stings there, title and the big html block....

 

see the numbers? 5 and 73?

 

title is 5 chars long, and the html string is 73 chars long.

 

so, if i change the word title to tit i HAVE to change the number to 3 see?

 

if even ONE of these numbers is wrong php will load it in as a blank array, and thats why you get reset settings.

Share this post


Link to post
Share on other sites

Posted · Report post

Thx Simon for these clear comments

 

Do I have the same issue with the V5 ?

 

If i put the right number (instead of 5 & 73), is that it could work ?

 

Thx

Share this post


Link to post
Share on other sites

Posted · Report post

Applying custom database changes !

 

Take an example, in the features set up tab, you decide to change the content of one of the following items : title, text, Media for any slide or box

or

you run an update query :

UPDATE    `wp_options` SET `option_value` = REPLACE(`option_value`, "XX", "YY")
WHERE     (`option_name` LIKE "pagelines_options%");

 

unfortunately after this update query I lose the updated values and fall on the basic configuration.

 

Share this post


Link to post
Share on other sites

Posted · Report post

Any reply please ?

Share this post


Link to post
Share on other sites

Posted · Report post

If I understand you correctly, you wish to use the database instead of simply using the options in the theme settings panel ?

Share this post


Link to post
Share on other sites

Posted · Report post

Exactly !

Need to know the difference between

1/ we use the setting panel to update a title or a text area and save it and

2/ a simple query update in the wp_options table

 

Thx

Share this post


Link to post
Share on other sites