Jump to content


Photo

Update wp_options


  • Please log in to reply
14 replies to this topic

#1 junico

junico

    Member

  • Members
  • PipPip
  • 13 posts
  • LocationParis
  • Framework Version:iblogpro4
  • Country: Country Flag

Posted 09 January 2013 - 04:55 PM

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
 

 



#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 09 January 2013 - 09:50 PM

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?



#3 junico

junico

    Member

  • Members
  • PipPip
  • 13 posts
  • LocationParis
  • Framework Version:iblogpro4
  • Country: Country Flag

Posted 10 January 2013 - 09:52 AM

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.

 



#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 17966 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 10 January 2013 - 12:44 PM

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



#5 junico

junico

    Member

  • Members
  • PipPip
  • 13 posts
  • LocationParis
  • Framework Version:iblogpro4
  • Country: Country Flag

Posted 10 January 2013 - 01:59 PM

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



#6 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 10 January 2013 - 03:25 PM

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?



#7 junico

junico

    Member

  • Members
  • PipPip
  • 13 posts
  • LocationParis
  • Framework Version:iblogpro4
  • Country: Country Flag

Posted 10 January 2013 - 04:01 PM

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 ?



#8 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 10 January 2013 - 04:49 PM

You can't edit a serialised array.

#9 junico

junico

    Member

  • Members
  • PipPip
  • 13 posts
  • LocationParis
  • Framework Version:iblogpro4
  • Country: Country Flag

Posted 11 January 2013 - 08:49 AM

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



#10 junico

junico

    Member

  • Members
  • PipPip
  • 13 posts
  • LocationParis
  • Framework Version:iblogpro4
  • Country: Country Flag

Posted 15 January 2013 - 09:13 AM

Any reply please ?



#11 Jenny

Jenny

    Advocate

  • Unicorn Store Dev

  • 2924 posts
  • LocationWV
  • Country: Country Flag

Posted 15 January 2013 - 03:31 PM

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?



#12 junico

junico

    Member

  • Members
  • PipPip
  • 13 posts
  • LocationParis
  • Framework Version:iblogpro4
  • Country: Country Flag

Posted 18 January 2013 - 11:13 AM

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



#13 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 18 January 2013 - 05:54 PM

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.



#14 junico

junico

    Member

  • Members
  • PipPip
  • 13 posts
  • LocationParis
  • Framework Version:iblogpro4
  • Country: Country Flag

Posted 21 January 2013 - 08:39 AM

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



#15 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 22 January 2013 - 01:10 AM

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.