Jump to content
MakeWebGames

Recommended Posts

Posted

Hi there MWG/MCCF members,

I am currently thinking of adding a new user_level to my incoming game in around 8 months. I have some Idea how to do it, but no Idea the with SQL'S. Currently learning SQL for the sake of the game mods & myself.

Would appreciate it if someone could help.

Thanks, for reading

Rasheed Saeed - Renkia - Kakashi Hatake

Posted

It's easy -.-..

 

  • Add a random number in the db (1000,5,ect) as the users Userlevel
  • Add it too the staff list, Also add the number in the top query
  • make a panel for it, Or edit you're staff panel
  • Add it in ViewUser..

Easily done :)

Posted
It's easy -.-..

 

  • Add a random number in the db (1000,5,ect) as the users Userlevel
  • Add it too the staff list, Also add the number in the top query
  • make a panel for it, Or edit you're staff panel
  • Add it in ViewUser..

Easily done :)

Thanks for that, made a new user level :)

Posted

I know that Jordan. xD

It's just the SQL mate. :)

userid` =2;

 

I Think you are just updating ID 2. I'm not very good at this stuff, but it should be ( $userid ) What Ive seen in some cases anyway.

Posted

I would personally make a new table called Staff thats not part of the user table.

so something like this would work..

[mysql]CREATE TABLE IF NOT EXISTS `staff` (

`staff_id` int(11) NOT NULL auto_increment,

`staff_level` int(11) NOT NULL,

`staff_status` varchar(20) NOT NULL,

`staff_duties` varchar(100) NOT NULL,

`staff_vacation` varchar(3) NOT NULL,

`staff_killer` varchar(3) NOT NULL,

PRIMARY KEY (`staff_id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1;[/mysql]

Posted

UPDATE users SET user_level = 200 WHERE userid = 1

 

That it? Wow, so simple. I thought it would be alot more work in the SQL's, lol. Well thanks for the Jordan. :)

Posted

[mysql]ALTER TABLE `userstablename` ADD `position` ENUM ('Administrator', 'Assistant', 'Member', 'Bot') NOT NULL DEFAULT 'Member'[/mysql]

try {
   if($user->position !== 'Administrator') {
       throw new errorMessage('Error: Access Denied');
    } 
} catch (errorMessage $em) {
   echo '<span class="error">'.$em->_message().'</span>';
}

Something to that effect I use.

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.   Paste as plain text instead

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