How can I find user role in Mysql?

I’ve decided to use plain Key according to @TomJNowell ‘s comments. If I would like to search a key in serialized data, I would get those serialized array from DB and use maybe_unserialize() in PHP OR use WP_User_Query in PHP. Thank you @TomJNowell

Find locations of all featured images of draft posts via SQL

Alright this worked for me: First run the bellow script to generate the file locations of all files used for draft posts. SELECT voybp_posts.guid FROM voybp_posts WHERE voybp_posts.ID IN (SELECT voybp_postmeta.meta_value FROM voybp_postmeta WHERE voybp_postmeta.post_id IN ( SELECT voybp_posts.ID FROM voybp_posts WHERE voybp_posts.post_status=”draft”) AND voybp_postmeta.meta_key=”_thumbnail_id”) Export this as a CSV file and save it to … Read more

How to check and get json object in WP database?

To check if a string from database is like a:2:{i:3;a:4:{s:5:”title”;s:0:””;s:4:”text”;s:503:”…}}, you can use the function is_serialized() To get the data as php array : if(is_serialized($data_as_string)){ $data_as_array = unserialize( $data_as_string); }

Restore of database doesn’t show content

Check that you are actually using the database by doing the following: 1 – go to cpanel, file manager, public_html, open the wp_config.php file 2 – check db creds and make sure it is actually the correct db. Everything must be exact. (IP/localhost, dbname, user, etc.) 3 – check the $table_prefix – make sure the … Read more