Jump to content

Recommended Posts

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.