nakash Posted June 13, 2010 Share Posted June 13, 2010 Hey there, I'm new to MYSQL and PHP and I'd like to ask a few questions; I have a database with 3 users and I want to check if that person is an administrator, I've already created the field 'Admin' in the database, but I don't know how to check it in the file. I'm using a login system and it saves the session of his ID and the name. $member = mysql_fetch_assoc($result); $_SESSION['SESS_MEMBER_ID'] = $member['id']; $_SESSION['SESS_FIRST_NAME'] = $member['Name']; Is there a way to check if that specific person is an admin? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/204677-how-to-check-if-the-person-is-an-admin/ Share on other sites More sharing options...
nakash Posted June 13, 2010 Author Share Posted June 13, 2010 Quote Hey there, I'm new to MYSQL and PHP and I'd like to ask a few questions; I have a database with 3 users and I want to check if that person is an administrator, I've already created the field 'Admin' in the database, but I don't know how to check it in the file. I'm using a login system and it saves the session of his ID and the name. $member = mysql_fetch_assoc($result); $_SESSION['SESS_MEMBER_ID'] = $member['id']; $_SESSION['SESS_FIRST_NAME'] = $member['Name']; Is there a way to check if that specific person is an admin? Thanks in advance. Sorry for doubleposting, but I couldn't edit this message. My second question is how do I do change a field of someone using his ID? ('id') I know it's something with UPDATE ;p Link to comment https://forums.phpfreaks.com/topic/204677-how-to-check-if-the-person-is-an-admin/#findComment-1071614 Share on other sites More sharing options...
fenway Posted June 13, 2010 Share Posted June 13, 2010 Sounds like you're asking how to use a database. Link to comment https://forums.phpfreaks.com/topic/204677-how-to-check-if-the-person-is-an-admin/#findComment-1071619 Share on other sites More sharing options...
James25 Posted June 14, 2010 Share Posted June 14, 2010 but what is the problem? Link to comment https://forums.phpfreaks.com/topic/204677-how-to-check-if-the-person-is-an-admin/#findComment-1071738 Share on other sites More sharing options...
nakash Posted June 14, 2010 Author Share Posted June 14, 2010 Quote Sounds like you're asking how to use a database. Oh.. nonono lol. I forgot to mention that I need those to be scripted in PHP. Link to comment https://forums.phpfreaks.com/topic/204677-how-to-check-if-the-person-is-an-admin/#findComment-1071753 Share on other sites More sharing options...
fenway Posted June 15, 2010 Share Posted June 15, 2010 Quote Quote Sounds like you're asking how to use a database. Oh.. nonono lol. I forgot to mention that I need those to be scripted in PHP. Right -- so you're asking how to query a database with PHP. Link to comment https://forums.phpfreaks.com/topic/204677-how-to-check-if-the-person-is-an-admin/#findComment-1072361 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.