Creating Tables in WordPress Database

It may be a wrong approach, but without creating a plugin, one of my seniors, once did a WordPress Shopping Cart project by creating extra tables for her custom purposes. What she did is to follow the other existing tables in WordPress database. Suppose what wp_posts table has by default is an ID. She opened … Read more

Copy site on same server?

yes Patrick, you need to install wordpress again in that directory and add a new databases or just use the existing one just put in mind that u should not use the same prefix which you used in your root installation, and after that just pop any en or english link in your root site … Read more

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