简体   繁体   中英

MySql query simple question

I am using a classified scripts and saves user_meta data in the wp_usermeta table. The meta_key field is called user_address_info and in it there are all the data like below :

s:204:"a:7:{s:9:"user_add1";s:10:"my address";s:9:"user_add2";N;s:9:"user_city";s:7:"my city";s:10:"user_state";s:8:"my phone";s:12:"user_country";N;s:15:"user_postalcode";s:10:"comp phone";s:10:"user_phone";N;}";

I am not using all the fields on the script but user_add1, user_city, user_state and user_postalcode

I am having trouble to get the data using SQL like the example below (wordpress) :

$mylink = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = 10", ARRAY_A);

I would like some help here so that I will display anywhere (I dont mind using any kind of SQL queries) the requested info eg the user_city of current author ID (eg 25)

Thank you very much.

只需使用wordpress函数即可: http : //codex.wordpress.org/Function_Reference/get_userdata

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM