0
votes

I am working on WordPress registration and login functionality. Actually I have 10 sites and I am making a single database table where these 10 sites can easily login and registered with same email and password. I mean same email and password can apply on these 10 sites login form through this single database table. In my 10 sites there is one WordPress site. So I want the customize the registration and login functionality of this. For my WordPress site I have make connect it with new database like:

$mydb = new wpdb('user','password','database','hostname');

after that I have check the database connection. it is working properly

Now I am getting a problem. I want to create a new user through this function

wp_create_user( $sanitized_user_login, $_POST['password'], $user_email );

when i am calling it through my new database connection like:

$mydb->wp_create_user( $sanitized_user_login, $_POST['password'], $user_email ); 

it is giving me blank result. So please tell me how can i get the all function of WordPress and use it for new database connection and create a new user in new database

Thanks

1

1 Answers

0
votes

wp_create_user is a wordpress function

wdpb is used to work with db tables, there is no function wp_crete_user in wpdb. So you need to read the doc to know how to add a user in users table wpdb