1

I have an existing MySQL database (not Wordpress) containing user profile information. I am looking for a way to allow these users to log in to a Wordpress site and edit their profile.

It is most likely I will need to write a plugin to do this, however I'm hoping that others have had the same requirement and a solution already exists. I've looked at using BuddyPress and GravityForms as possible vehicles but they don't seem to allow connection to an existing database.

The remote database user profiles contain things like clothing sizes and profile pictures; more than the Wordpress profile. About the only thing that is not in the profiles is an email address and password.

The remote database is large and is used by other software clients, so it can not be imported or migrated into Wordpress.

1 Answer 1

1

You can use the WPDB class to instantiate an external DB.

Looks like roughly this:

define('EXT_DB_USER', 'username');
define('EXT_DB_PASSWORD', 'password');
define('EXT_DB_NAME', 'ext_data' );
define('EXT_DB_HOST', '123.123.123.123:3307');

$wpdb_ext = new wpdb(EXT_DB_USER, EXT_DB_PASSWORD, EXT_DB_NAME, EXT_DB_HOST);

then you just call $wpdb_ext with normal WP functions just like you would #wpdb.

For log in info it's usually easiest to sync login information.

If you really want to build your own oAuth type solution take a look at KeyRing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.