mySQL and phpBB

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Kain Elderan
Forum Newbie
Posts: 4
Joined: Thu Mar 16, 2006 8:00 am

mySQL and phpBB

Post by Kain Elderan »

Hi all,

I'm rather new here but I glanced around abit and couldn't find any answers to my questions so here goes.

I currently have a phpBB forum setup on my website. Dunno if anyone here is very familiar with this forum software or not, it uses mySQL. Anyways, I have been learning some PHP and mySQL lately but I'd still consider myself a newbie to it. I need some help on a project I'm working on if possible.

My project is basically building a mySQL database for tracking of group assets in an online game I play, as well as doing calculations and such. I've managed to get some stuff working, as you can see here. Don't mind the errors at the top, that was a user login interface I tried out but don't really care for.

Now what I am trying to do is integrate this database into my phpBB forum database, so that I can give people access to the pages based off their forum access (basically make certain pages only available to our memebers). I have already imported the seperate database into my phpBB database, but I'm unsure where to go from here. Looking over the phpBB database through phpMyAdmin, I was thinking it would probably be best to use the user's rank, which is found in the "phpbb_users" table, under "user_rank".

My question though is where to go from here? I need to build something to query the users rank based off their login, then allow them access via that. If anyone that knows phpBB could assist me I'd greatly appreciate it. I posted in the phpBB forums but haven't really received much assistance there. Thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

user_rank is probably not the best field to work against as the rank can be custom set. I'd use the user group table instead. In order to link the user against their group(s), you'll need a join. See what you can figure out on your own for a bit, and post back if you have further questions. It may be best to have some code or an SQL queries you've tried so we can nudge you in the right directions.
Kain Elderan
Forum Newbie
Posts: 4
Joined: Thu Mar 16, 2006 8:00 am

Post by Kain Elderan »

Is there a variable already assigned to the user once the are logged in? The problem I'm having is figuring out how to do a query against the user that is currently logged in, to check their group. If I can get past that then I can make some progress.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

In phpBB $userdata is filled with some user specific information, however authorization and authentication is run through a separate system (I think the function they call is getAuth() or auth() something like that.
Post Reply