admin管理员组

文章数量:1279084

In my WordPress database, in the options table, there is a field in the option_name column which is called titb_flc_options, whose value is this:

s:397:"a:10:{
    s:16:"69c3d01e88aba503";
    s:0:"";
    s:12:"titb_flc_url";
    s:34:"/";
    s:17:"titb_flc_btnlabel";
    s:15:"Chiedi al guru!";
    s:18:"titb_flc_titlesize";
    s:4:"true";
    s:17:"titb_flc_language";
    s:5:"it_IT";
    s:16:"a65a212aa62e5e30";
    s:0:"";
    s:11:"button_icon";
    s:15:"003-messenger-1";
    s:11:"button_size";
    s:10:"flc_medium";
    :15:"button_position";
    s:5:"right";
    s:14:"button_animate";
    s:1:"1";
}";

How do I select the value, for example: / to display it on the screen?

In my WordPress database, in the options table, there is a field in the option_name column which is called titb_flc_options, whose value is this:

s:397:"a:10:{
    s:16:"69c3d01e88aba503";
    s:0:"";
    s:12:"titb_flc_url";
    s:34:"https://www.facebook/wired/";
    s:17:"titb_flc_btnlabel";
    s:15:"Chiedi al guru!";
    s:18:"titb_flc_titlesize";
    s:4:"true";
    s:17:"titb_flc_language";
    s:5:"it_IT";
    s:16:"a65a212aa62e5e30";
    s:0:"";
    s:11:"button_icon";
    s:15:"003-messenger-1";
    s:11:"button_size";
    s:10:"flc_medium";
    :15:"button_position";
    s:5:"right";
    s:14:"button_animate";
    s:1:"1";
}";

How do I select the value, for example: https://www.facebook/wired/ to display it on the screen?

Share Improve this question edited Oct 30, 2021 at 2:09 Picard 1,1552 gold badges13 silver badges21 bronze badges asked Oct 25, 2021 at 10:06 Marco DedoMarco Dedo 214 bronze badges 2
  • 2 Is there a reason you’re using an SQL query instead of just get_option()? – Jacob Peattie Commented Oct 25, 2021 at 10:26
  • The value contained in the database is the remnant of an old framework, in fact if I try to use get_option () it returns me a string(397), instead I have to retrieve the individual values of the array. I hope I have explained... – Marco Dedo Commented Oct 25, 2021 at 10:36
Add a comment  | 

1 Answer 1

Reset to default 1

I think I have found the answer to my question, the audience in case it might be of help to someone else:

$risultato =  maybe_unserialize(get_option('titb_flc_options'));    
echo $risultato['titb_flc_url'];

本文标签: phpSQL QUERYSelect a value directly from the database