I know i have already asked this question but i didn't want to reply to an old thread :)

But i have made a second table in my database named members_info the other table is named members and it holds the usernames and passwords.

My question is how can i have a users username in there and make certain permissions for this person?

Thanks !

You could also just extend the members table and add a new column named 'permission' that is an integer. The integer corresponds with the level of authentication:

0 :: Member
1 :: Admin
2 :: Superadmin
3 :: President
4 :: Superman

Something like that. And in the code you can test that value: if ($permission > 2) { ....... } ~G

Wouldnt that require 5 new fields in members ? And then how would i assign a user either 0, 1, 2, 3, 4 or 5?

Wouldnt that require 5 new fields in members ?

No, only 1 field: permission. E.g.

Username Password Permission
--------- --------- -----------
Dude secret 2
Guy cube 0

And so on.

And then how would i assign a user either 0, 1, 2, 3, 4 or 5?

When you insert an user to the database, for example when he registers, he is standard assigned member (0) permission. You could write a script that allows users to assign permission to users below its own permission (e.g. an superadmin can make a member admin, but can't make a member superadmin or president).

You can make it as complex as you want.

~G

Thanks i've got my database set up now i just need to define privileges. Now that i think of it that seems kind of easy lets see if i can work out the php code now :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.