Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8663605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:01:39+00:00 2026-06-12T17:01:39+00:00

Okay, so I have created a user table inside of my database to hold

  • 0

Okay, so I have created a user table inside of my database to hold all the users data

CREATE TABLE `user` (
`id` INT NOT NULL auto_increment,
`username` VARCHAR(50) NOT NULL default '',
`nicename` VARCHAR(255) NOT NULL default '',
`email` VARCHAR(255) NOT NULL default '',
`password` VARCHAR(255) NOT NULL default '',
`permissions` INT NOT NULL default '1',
UNIQUE KEY `user_n` (`username`),
UNIQUE KEY `user_e` (`email`),
    PRIMARY KEY (`id`)
);

I want the permissions field to dictate what users can and cannot see. IE. The permissions for the ACP would require a permissions level of 3 whereas 1 is a registered user and 0 is a guest visiting the site. How could I get a page to block itself depending upon a users permission level? Thanks in advance.
Using MySQL/PHP

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:01:40+00:00Added an answer on June 12, 2026 at 5:01 pm

    have the user login , fetch his permissions from table and depending upon the permission redirect him/her to appropriate page e.g.
     

    $dbh = new PDO("mysql:dbname=dbname;host=hostname", "username", "password" );
    $result = $dbh->prepare("select check_user_exists(?) as retval");
    $result->bindParam(1, $value, PDO::PARAM_STR, 2);
    $result->setFetchMode(PDO::FETCH_CLASS, 'stdClass');
    $result->execute(); 
    switch($result) {
     case 1 : $header('Location:x.php');
     case 2 : $header('Location:y.php');
     case 3 : $header('Location:z.php'); 
     default 'no suitable page found');
     break;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, here's the situation: We have a table of about 50 columns (created by
Okay, so let's say I have a mysql database table with two columns, one
I have a database called bmto with a table users in it. I used
Okay, so i have created a new support ticket system, but in my ticket
Okay, I have the following create action #posts_controller, nested resource under discussions def create
Okay I have updated my code a little, but I am still not exactly
Okay, so I have a MySQL database set up. Most of the tables are
Okay I have created an application where in one of the screens I have
Okay, so i've created my c# application, created an installer for it and have
Okay. I have a main UI with buttons on it. When a user clicks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.