Have 2 db's, 1 for site and 1 for forums. Need to consolidate users


I have a flash game site and a forum for it and they have different db's. I actually just created the forums yesterday so there are only a few users. I want the users to only have to register once.

How can I do this?

mysql db.

In the db the prefixes are ava for the site and phpbb for the forum. I'm not sure how to go about this without breaking one of the sites.

pleas advise
thank you!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You should do this:

1. Make a backup of db1 and db2 user's tables.

2. Add users on db1 to users on db2. You should think about how to solve the conflicts: if db1 and db2 have the same user what to do ?

3. Drop users table on db1.

4. Create a view on db1 with the same name users table had. This view should get data from db2 users table.

5. If you want to be able to add users on db1, create triggers for doing this, or modify your programming code (maybe php?) to insert to db2 table instead of db1.

Hope it helps.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott MadeiraCommented:
Another thing you will need to work through is how the passwords are stored in each database.  If they are encrypted but use differing mechanisms then you need a way to get the password sync'd.

Even if they are both using something simple like MD5 to encrypt, if they have different salts in their encryption you will get different passwords.

You may find that you have to create a custom registration form that gathers all of the fields required by both tables (some will be common to both and some will be unique to one or the other.)

With your custom registration form you would need to call the "create user" function in each of the two applications.
Ray PaseurCommented:
You can specify the data base name in the query or you can select a data base as the default DB for the queries.  With two DBs you might be best off putting the DB name directly into the query.

If both data bases are accessed via the same domain name, you can use http cookies to carry authentication information.  The general design for this sort of login-and-remember-me uses the PHP session with longer-term login patterns implemented by using a cookie.  You can see the moving parts and the code samples in this article.

Here is what I might try.  Add the userTable to one of the data bases.  Locate the authentication modules in each of the subsystems and replace those with something like the access_control() function described in the article.  Hook the registration and authentication queries up with the data base that contains the userTable.  This is not rocket science, just plodding work to check all the places that client authentication is used in the two subsystems.

As an alternative you might consider using http://en.wikipedia.org/wiki/OAuth or http://en.wikipedia.org/wiki/OpenId
DantechITAuthor Commented:
Thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.