Jump to content

setting user levels


dubt2nv

Recommended Posts

i currently have a mysql run database website...atm i have a tbale called users which contains the info on the username, password, and login details for ppl.....i also have a field called 'level' where the suers level is recorded, eg Admin, Owner.....i want to be able to set these 2 allow the owner to access everything and only allow the admin to access certain things....how would i do this????
Link to comment
https://forums.phpfreaks.com/topic/27833-setting-user-levels/
Share on other sites

[code]
$cn=@mysql_connect("host","username","password") or die(mysql_error());
@mysql_select_db("db_name",$cn) or die(mysql_erro());

$result=@mysql_query("SELECT `level` FROM `users` WHERE `username`=$username",$cn) or die(mysql_error());
$row=mysql_fetch_array($result)
if($row[level]=="owner")
{
echo "owner stuff";
}
else
if($row[level]=="admin")
{
echo "admin stuff";
}[/code]
Link to comment
https://forums.phpfreaks.com/topic/27833-setting-user-levels/#findComment-127354
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.