import (migration) user database to wp-users

get all data from DB1( non-wp-database ) and save to an $array. Use this wordpress code inside your functions.php for insert users into DB2 ( wordpress database). function cxg_wp_insert_user() { foreach ( $array as $arr ) { $user_data = array( ‘ID’ => ”, ‘user_pass’ => wp_generate_password(), ‘user_login’ => $loginName, ‘user_nicename’ => $nicename, ‘user_url’ => ”, … Read more

WordPress site seems convinced that it’s still at its old URL

Silly mistake on my part, At some point I defined my wp-content directories right in wp-config. define( ‘WP_CONTENT_DIR’, ‘/home/user/public_html/site/subdirectory/wp-content’ ); define( ‘WP_CONTENT_URL’, ‘http://www.seocial.ly/site/subdirectory/wp-content’ ); Completely overlooked this when editing my wp-config.

Get data from 3rd table

I simplified your query, but wouldn’t something like this accomplish it? SELECT * FROM $wpdb->posts AS p LEFT JOIN $wpdb->postmeta AS pm ON p.ID = pm.post_id LEFT JOIN users AS u ON pm.meta_value = u.user_id WHERE pm.meta_key = ‘user_id’ AND post_status=”publish” ORDER BY p.ID DESC LIMIT 50;

/var/run/mysqld/mysqld.sock

I am not sure why lately ppl define the path to their DB_HOST like you do. (Assuming it is a way server is configurated (or using a MAC) and/or as pseudo layer of security?) Anyway, you will have your reason for it, maybe one of these codelines below could help you. define(‘DB_HOST’, ‘:/var/run/mysqld/mysqld.sock’); I could … Read more

WordPress ERD mistake?

I found the reason: term_id is the ID of a term in the terms table. term_taxonomy_id is a unique ID for the term + taxonomy pair. see: What’s the difference between term_id and term_taxonomy_id Still, I think it’s a bit strange to do it this way. Also because I think it doesn´t make sence to … Read more

MYSQL Join on meta key value?

You can update just joining both table on comparing same userid. like: update t1 join t2 on t1.user_id = t2.user_id set t1.meta_value = t2.desc;