Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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