dubt2nv Posted November 20, 2006 Share Posted November 20, 2006 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 More sharing options...
fert Posted November 20, 2006 Share Posted November 20, 2006 [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";}elseif($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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.