MyBB Community Forums

Full Version: Existing Database Integration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I am currently building a site thats relying on a user base of "registered members". I am looking for a forum solution that has many of the features covered by MyBB, but I want to know if its possible to have that user base automatically signed up for the forum when they register, and to keep the same Usernames, profile (if possible), etc.

There are so many positives to this for me, if anybody can lead me in the right direction or send me some links or give me some answers it would be extremely appreciated. I dont see something like this on the site, and numerous searches of the forums didnt get me what I was looking for.

Thank you very much in advance for all help and for reading my post.

Humbick
This is possible with a customized plugin or an extra sql insert query, depending on which way you want to do it.

If you have people signup using the MyBB registration page, then you would need to write a customized plugin that creates a new row in your main site's database. As for plugins, you can start from here http://wiki.mybboard.net/index.php/Plugins , and learn about hooks. Then you can take example from other plugins for reference.

If you have people signup through your main site, then you would need to have to insert a row into the MyBB database upon registration. EX: INSERT INTO mybb_users VALUES{value1, value2, all_the_values_of_the_user_table}

The third option is to share the same database, probably the easiest way.
Jeff Wrote:This is possible with a customized plugin or an extra sql insert query, depending on which way you want to do it.

If you have people signup using the MyBB registration page, then you would need to write a customized plugin that creates a new row in your main site's database. As for plugins, you can start from here http://wiki.mybboard.net/index.php/Plugins , and learn about hooks. Then you can take example from other plugins for reference.

If you have people signup through your main site, then you would need to have to insert a row into the MyBB database upon registration. EX: INSERT INTO mybb_users VALUES{value1, value2, all_the_values_of_the_user_table}

The third option is to share the same database, probably the easiest way.

Awesome. This was really helpful. Especially option 2. Would you be able to elaborate on option 3; how do you "share" the databases? just have it mirrored somehow?

Thank you so much also for such a fast response.
Humbick Wrote:Awesome. This was really helpful. Especially option 2. Would you be able to elaborate on option 3; how do you "share" the databases? just have it mirrored somehow?

Thank you so much also for such a fast response.

When I mean share the same database, I meant that the user info of your main site goes into the same table (mybb_users) of the MyBB user info.

For example, on your main site, you may want a "Paypal id" for each user. Instead of putting this info on a separate table on a separate database, you would store it into the existing mybb_users table. And when you need something like username and password, where it is the same for both the forums and the main site, you would retrieve it from the same table.

The advantage I see to this is that it is much easier to manage, instead of having two separate tables on separate databases, constantly remembering which is stored where and worrying whether or not the data match. The disadvantage would probably have to do with efficiency, specially if you access the main site data much more often that the forum data.

However, if you were to implement this method, you still need to decide whether to let users register through the forum registration page(option1) or through your main site(option2).

I hope I didn't lost you there.