I want to share wp_users table of my two websites hosting on same server
-
I have two portal hosting on same server
http://educationspark.com/ (root)Inside root i have made a folder BLOG where i have put my blog content
see the url below….
http://educationspark.com/BLOGI have put the db-config file in root of educationspark.com and db.php inside wp-content
Below is the code which i have written in db-config.php
/** Sample Configuration 2: Partitioning **/ /** * This example shows a setup where the multisite blog tables have been * separated from the global dataset. */ $wpdb->add_database(array( 'host' => 'estate.websitewelcome.com', 'user' => 'educatio_espark', 'password' => 'SwMZFa^W&m2$', 'name' => 'educatio_spark', )); $wpdb->add_database(array( 'host' => 'estate.websitewelcome.com', 'user' => 'educatio_BLG12', 'password' => '4(mn=DDXh)t5', 'name' => 'educatio_BLOG', 'dataset' => 'users', )); $wpdb->add_callback('add_shared_users'); function add_shared_users($query, $wpdb) { // Multisite blog tables are "{$base_prefix}{$blog_id}_*" if ( preg_match("/^{$wpdb->base_prefix}\d+_/i", $wpdb->table) ) return 'users'; }
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
Problem is i have tested the same code in my localhost…code is running fine, user are get shared between two portals…….but when i am using the same code in live site….. users are not get shared.
I want if user register on http://www.educationspark.com/BLOG/ he/she will automatically get registered on http://www.educationspark.com/
Please help me to correct my code.
- The topic ‘I want to share wp_users table of my two websites hosting on same server’ is closed to new replies.