Thursday 15 January 2015

php - How to use wordpress function on a new custom WPDB -


I want to create a user on both of my sites with different databases. On my first site I code: -

  $ newdb = new wpdb ('XYZ', 'MXCTv # @', 'XYZ', 'DB URL'); $ Newdb- & gt; Show_errors (); $ Usermain = $ newdb- & gt; Get_results ("SELECT * FROM wp_users"); It is possible to use wp_create_user ($ username, $ password, $ email) function for the new database object.  

Thanks in advance.

If you want to share users between two sites, then the custom user table Consider setting up, with two different DB prefixes for each site:

Alternatively, you can enable WP MultiSite with domain mapping:



No comments:

Post a Comment