Creating multi user role based admin using php mysql and bootstrap

144

Last two weeks I was quite busy with projects and hardly had any spare time left for writing blogs. I had a huge backlog of mails requesting for tutorials. One thing I found common among them was creating a multi user role based admin feature. I googled for the article so I can give them links but I was not able to find useful tutorial. So i decided to make it myself for my readers. In this tutorial I will be Creating multi user role based admin using php mysql and bootstrap library.

View Demo

What is multi user role based admin?

For novice users let me explain what this article is all about. Suppose you have an online inventory store. You have multiple employee each has their specific roles. i.e some person are responsible for feeding data (Data Operator), some are responsible for customer support and some for sales. In this case you don’t want all your modules/data to be available to every one of them. So what you have to do is to assign a role to them, and then they will have the privilege to access limited data only.

In this tutorial I am not going to make a full fledged admin panel. I will show the trick using mysql database and php logic to create multi user admin. Follow the steps below.

Step 1. Create a database and add modules,system users, role and their rights.

The first step is to create a database. I have created a database named multi-admin. Create some modules that you will be using in your application. Check the sample sql below.

Once you have created modules table, feed some data into it. I have used purchases, sales, stocks and Shipping, payment and taxes. So there are 6 modules in two groups.

Create roles that will be assigned to the admins.

Add system user/admin who will manage the application. Assign each admin with a role.

The final step is to give each role the privilege to access modules. I have used 4 options i.e create, edit, view and delete.

Step 2. Create files for every single modules.

This step is very easy. You have to create files for each modules based on names you have given in the database (module table). Apart from the 6 pages that are given the database, you have to create 3 more pages viz. login.php (user will login), dashboard.php (user will see the menu/modules), and logout.php (to clear the session).

Step 3. Creating login form.

If you have followed my earlier tutorials, you should know that I use PDO classes to access the database. If you are new to PDO classes try learning it from a sample mini-project Simple address book with php and mysql using pdo.

Create a file name config.php to set up basic configuration.

Validating user login using PHP

Once you are logged in you are redirected to dashboard.php where you will see the menu/modules that are assigned as per your role. Your role is saved in session when you are logged in.

In the above script all the data are passed into a function named set_rights() which return an array based on user roles.

Once you have all the modules based on your role in a session variable. Display it as list menu.

Step 4. Conditional checking for each modules functionality.

In this step you have to manually check write a security check for a module functionaliy. Let say user has the right to create, edit and view purchases but not delete it. In this case you have to add a conditional checking before each buttons/links. See a sample below for purchases.php page module.

Step 5. Validation for logged in and non-logged in user.

Another security checking, you can add this checking for individual page. check the two test cases below.

  • If user is logged in and trying to access login page. User will be redirected to dashboard.
  • If user is not logged in and trying to access any page expect login page. User will be redirected to login page.

You can also add another layer of security check for each modules pages if you want. In case if user is trying to access a modules using direct page URL but is not assigned for, they must not passed this security check.

Step 6. Logout Page.

The step is just for clearing the session and redirecting user back to login page.

View Demo
Download

Share.
 

About Author

Entrepreneur & Dreamer

I am a passionate Software Professional, love to learn and share my knowledge with others.

Software is the hardware of my life.

144 Comments

  1. Hi sharuk

    if we use “OR” opertor in In Page level security check , will it retrieve all data?
    so we can access below operations right?
    create, edit, delete, view.
    Please explain

  2. Suman Chhetri on

    I downloaded the contents and configured database as instructed but when I’m logging in as ‘Ronald’ , no option is available. When I login through ‘Shahrukh’, only then menu options are visible. Need your assistance.

  3. Thank you for the tutorial, i have followed every step but i am not able to login, also does ” alidating user login using PHP” code go into the config file..

    I am just a step away to getting this Kindly help

  4. Hi there, always i used to check weblog posts here in the early hours in the morning, for the reason that i enjoy to learn more and more.

  5. HI Shahrukh,
    i am developing a wordpress website with huge data with lots of images ..
    if i want to change the website look ..i will upload that whole data again one by one which takes lots of time.
    is there any way to insert bulk data at a time??
    please help me
    Thanks in advance.

  6. What happen if you want to create multilevel menu with modules, now you only allow one sub – level
    It will be something like this : Banking -> Accounts -> Others…

  7. Hi
    Trying to set this up but I am struggling.
    Can you show the sql code to create the role_rights table.

    I can’t see the function redirect that should be in the functions php

    Could you assist

    Thank you

  8. Thank you for this amazing tutorial!
    I would like to ask if it’s possible to do the same but instead with a website, using android! So far I’ve already created the database and I am capable to insert and modify values, but I’m not sure how I would relate the roles depending of the user… thanks!

  9. mr khan i have share your website link to my facebook but the downloading option is not avaliabe so pls help me.send the downlaoding link to my email id “3dbalamurali@gmail.com”

  10. Hi bro i am unable to convert your sql code to codeigniter like prepare which is in dashboard.php but i loved your code please help me out buddy how should i write this code in codeigniter

    • Hi bro . i am not that expert in codeignitor but all you have to do is create a model that will have query part to fetch the permission from database. In the controller you can set the access right in the session variable from models and in the views you can give condition based on that. just the theory on how MVC works. hope this will provide you the guideline.

  11. hello,
    excuse my English is so bad
    in your function you are
    function set_rights($menus, $menuRights, $topmenu)
    but $topmenu is not use anywhere,

    Please can you reply

  12. Sorry, my English is bad
    Hello, to be used as mysqli, these functions should be modified as what?
    Please reply

    function set_rights($menus, $menuRights, $topmenu) {
    $data = array();

    for ($i = 0, $c = count($menus); $i < $c; $i++) {

    $row = array();
    for ($j = 0, $c2 = count($menuRights); $j < $c2; $j++) {
    if ($menuRights[$j]["rr_modulecode"] == $menus[$i]["mod_modulecode"]) {
    if (authorize($menuRights[$j]["rr_create"]) || authorize($menuRights[$j]["rr_edit"]) ||
    authorize($menuRights[$j]["rr_delete"]) || authorize($menuRights[$j]["rr_view"])
    ) {

    $row["menu"] = $menus[$i]["mod_modulegroupcode"];
    $row["menu_name"] = $menus[$i]["mod_modulename"];
    $row["page_name"] = $menus[$i]["mod_modulepagename"];
    $row["create"] = $menuRights[$j]["rr_create"];
    $row["edit"] = $menuRights[$j]["rr_edit"];
    $row["delete"] = $menuRights[$j]["rr_delete"];
    $row["view"] = $menuRights[$j]["rr_view"];

    $data[$menus[$i]["mod_modulegroupcode"]][$menuRights[$j]["rr_modulecode"]] = $row;
    $data[$menus[$i]["mod_modulegroupcode"]]["top_menu_name"] = $menus[$i]["mod_modulegroupname"];
    }
    }
    }
    }

    return $data;
    }

    // this function is used by set_rights() function
    function authorize($module) {
    return $module == "yes" ? TRUE : FALSE;
    }

    Read more: https://www.thesoftwareguy.in/creating-multi-user-role-based-admin-using-php-mysql-bootstrap/#ixzz3zdIF0RiJ

  13. I created role_rights table as:

    CREATE TABLE IF NOT EXISTS role_rights (
    rr_rolecode int(11) NOT NULL,
    rr_modulecode varchar(100) NOT NULL,
    rr_create varchar(25) NOT NULL,
    rr_edit varchar(25) NOT NULL,
    rr_delete varchar(25) NOT NULL,
    rr_view varchar(25) NOT NULL,
    FOREIGN KEY (rr_rolecode) REFERENCES role (role_rolecode) ON UPDATE CASCADE ON DELETE RESTRICT,
    FOREIGN KEY (rr_modulecode) REFERENCES module (mod_modulecode) ON UPDATE CASCADE ON DELETE RESTRICT
    ) ENGINE=INNODB DEFAULT CHARSET=utf8;

    BR,
    Rbn

  14. Hi Shahrukh,

    I’m unable to view this application as in demo.
    I’m getting this SQLSTATE[HY000] [1049] Unknown database ‘multi-admin’ when i run, can you please guide me on this. I’m new for PHP

    • Hello Shilpitha.
      Make sure you have already created a database ‘multi-admin’ in your mysql database. If already created make sure you spelt it correctly. Best of luck.

    • Hi. Thanks very much for this wonderful input. Kindly help me understand how to create the table for the role_rights. Thanks

  15. Hallow Shahrukh,

    I have understood reason for these fields mod_modulegrouporder and mod_moduleorder in module table

  16. I am trying to do this website I have not uploaded it yet. I might do on the intranet then the internet. I have a problem. Which page does the code between step 3 and 4 go. I am confused about that.

    • Just create a form in your login.php (or whatever page you want) and when you give the action of the page where the code to validate the user is given after that. Just use the code in whatever file you have named.

      • Thanks a lot. I will try to do actually I m new to PHP and am trying to learn. Single user I have been doing in general but this is new.

  17. Hi dude ,i just view your blog that’s awesome. I have problem please help me ,i download your source code and use it as demos whenever i’m click on Add button for add new item it’s not show the insert form please help me for this.

  18. Hey Good Job bro,
    But in admin lte panel there is a big issue of session, Session automatically expired still i have set it for 8 hour and after session expire login again and its not loading all menu,

    Please help

      • Yes i can understand but this is not the issue of bootstrap this is issue your php code.
        Cam you plz help .
        You can laso check it in demo plz login once and clear the cookie it will logout automatically and login again you are not able to see menu thas the problem

  19. I need 5 admins, How can i create them?
    As There are only two users(Super admin and Admin) in your code.

  20. Thanks for this great tutorial

    In your tutorial, the accessed page is only one per module (lets say in “module code of Payment” there is a page of “payment.php” (only one page) – in the “module code of Shipping” there is a page of “shipping.php”).

    My question is, How if we want to make the user can access to several pages instead of one (example, in the “module code Payment” there will be “payment.php” and “payment1.php” and “payment2.php”)

    Thank You.

  21. hey bro when i try to create table like:

    CREATE TABLE IF NOT EXISTS role_rights (
    rr_rolecode int(11) NOT NULL,
    rr_modulecode varchar(100) NOT NULL,
    rr_create varchar(25) NOT NULL,
    rr_edit varchar(25) NOT NULL,
    rr_delete varchar(25) NOT NULL,
    rr_view varchar(25) NOT NULL,
    FOREIGN KEY (rr_rolecode) REFERENCES role (role_rolecode) ON UPDATE CASCADE ON DELETE RESTRICT,
    FOREIGN KEY (rr_modulecode) REFERENCES module (mod_modulecode) ON UPDATE CASCADE ON DELETE RESTRICT
    ) ENGINE=INNODB DEFAULT CHARSET=utf8;

    it is showing: MySQL said: Documentation

    #1005 – Can’t create table ‘multi-admin.role_rights’ (errno: 150) (Details…)

    what is the reason plzz give me working code of creating table named: role_rights

  22. //
    CREATE TABLE IF NOT EXISTS role_rights (
    rr_rolecode int(11) NOT NULL,
    rr_modulecode varchar(100) NOT NULL,
    rr_create varchar(25) NOT NULL,
    rr_edit varchar(25) NOT NULL,
    rr_delete varchar(25) NOT NULL,
    rr_view varchar(25) NOT NULL,
    FOREIGN KEY (rr_rolecode) REFERENCES role (role_rolecode) ON UPDATE CASCADE ON DELETE RESTRICT,
    FOREIGN KEY (rr_modulecode) REFERENCES module (mod_modulecode) ON UPDATE CASCADE ON DELETE RESTRICT
    ) ENGINE=INNODB DEFAULT CHARSET=utf8;
    //
    When I’ve adding this thru phpmyadmin I get this:
    MySQL said: Documentation

    #1215 – Cannot add foreign key constraint

  23. hi, tks for your shared
    but I got an mistake, When I click in /purchases.php : back to Dashboard .. the page only show Inventory when I click /purchases.php and click back to Dashboard ..the page no show any page… Pls help
    tks

  24. Great work sir. but theptoblem I have is that the add, edit and delete functions does not work. when I click, it doesnt respond. Please help me

  25. SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘multi-admin.module.mod_modulegroupname’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

  26. Hi, Bro…Ami Role Table A Data insert Error Problem……Plz Solve Me Brother

    require(“config.php”);
    if (isset($_REQUEST[“sub”])) {

    $role_rolecode = trim(($_REQUEST[“p_name”]));
    $role_rolename = trim(($_REQUEST[“p_age”]));
    if ($p_name “” && $p_age “”) {
    $sql = “INSERT INTO role (role_rolecode, role_rolename) VALUES (:n, :a);”;
    $success_message = ‘Data has been inserted successfully.’;
    try {
    $stmt = $DB->prepare($sql);
    $stmt->bindValue(“:n”, $p_name);
    $stmt->bindValue(“:a”, $p_age);

    $stmt->execute();

    if ($stmt->rowCount()) {

    } else {
    printErrorMessage(“could not insert into database. Please try again”);
    }
    } catch (Exception $ex) {
    printErrorMessage($ex->getMessage());
    }

    } else {

    }
    }
    ?>

    Database Sample Script – http://www.thesoftwareguy.in

    Sample Database Script :: Add Record

    Back to Homepage

    Role:

    Role Name:

  27. Hi Shahrukh,

    NEED HELP !!!

    I have a problem while logging in.
    It accepts the Username and Password correctly through Database table system_users, but doesn’t logs into the website to dashboard. Instead, it again redirects me to Index page.

    Would you help me with this issue ?

  28. correct table definition:

    CREATE TABLE IF NOT EXISTS role_rights (
    rr_rolecode varchar(50) NOT NULL,
    rr_modulecode varchar(25) NOT NULL,
    rr_create varchar(25) NOT NULL,
    rr_edit varchar(25) NOT NULL,
    rr_delete varchar(25) NOT NULL,
    rr_view varchar(25) NOT NULL,
    FOREIGN KEY (rr_rolecode) REFERENCES role (role_rolecode) ON UPDATE CASCADE ON DELETE RESTRICT,
    FOREIGN KEY (rr_modulecode) REFERENCES module (mod_modulecode) ON UPDATE CASCADE ON DELETE RESTRICT
    ) ENGINE=INNODB DEFAULT CHARSET=utf8;

  29. assalaamu alaikum,
    Sorry, if my english is not good.
    thank you for your shared.
    Can i add any module other than create, edit, view and delete?

      • I’ve tried, but not yet.
        In addition to the Create, Edit, View, and delete module, I want to add the module Balas and Terima.

        This database role_rights:

        CREATE TABLE IF NOT EXISTS role_rights (
        rr_rolecode varchar(50) NOT NULL,
        rr_modulecode varchar(25) NOT NULL,
        rr_create enum(‘yes’,’no’) NOT NULL DEFAULT ‘no’,
        rr_edit enum(‘yes’,’no’) NOT NULL DEFAULT ‘no’,
        rr_delete enum(‘yes’,’no’) NOT NULL DEFAULT ‘no’,
        rr_view enum(‘yes’,’no’) NOT NULL DEFAULT ‘no’,
        rr_balas enum(‘yes’,’no’) NOT NULL DEFAULT ‘no’,
        rr_terima enum(‘yes’,’no’) NOT NULL DEFAULT ‘no’,
        PRIMARY KEY (rr_rolecode, rr_modulecode),
        FOREIGN KEY (rr_rolecode) REFERENCES role (role_rolecode) ON UPDATE CASCADE ON DELETE RESTRICT,
        FOREIGN KEY (rr_modulecode) REFERENCES module (mod_modulecode) ON UPDATE CASCADE ON DELETE RESTRICT
        ) ENGINE=INNODB DEFAULT CHARSET=utf8;

        INSERT INTO role_rights (rr_rolecode, rr_modulecode, rr_create, rr_edit, rr_delete, rr_view, rr_balas, rr_terima) VALUES
        (‘SUPERADMIN’, ‘PURCHASES’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),
        (‘SUPERADMIN’, ‘STOCKS’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),
        (‘SUPERADMIN’, ‘SALES’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),
        (‘SUPERADMIN’, ‘SHIPPING’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),
        (‘SUPERADMIN’, ‘PAYMENT’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),
        (‘SUPERADMIN’, ‘TAX’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),
        (‘ADMIN’, ‘PURCHASES’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘no’, ‘no’),
        (‘ADMIN’, ‘STOCKS’, ‘no’, ‘no’, ‘no’, ‘yes’, ‘no’, ‘no’),
        (‘ADMIN’, ‘SALES’, ‘no’, ‘no’, ‘no’, ‘no’, ‘no’, ‘no’),
        (‘ADMIN’, ‘SHIPPING’, ‘yes’, ‘yes’, ‘yes’, ‘yes’, ‘no’, ‘no’),
        (‘ADMIN’, ‘PAYMENT’, ‘no’, ‘no’, ‘no’, ‘yes’, ‘no’, ‘no’),
        (‘ADMIN’, ‘TAX’, ‘no’, ‘no’, ‘no’, ‘no’, ‘no’, ‘no’);

        Script on file functions.php :

        function set_rights($menus, $menuRights, $topmenu) {
        $data = array();

        for ($i = 0, $c = count($menus); $i < $c; $i++) {

        $row = array();
        for ($j = 0, $c2 = count($menuRights); $j < $c2; $j++) {
        if ($menuRights[$j]["rr_modulecode"] == $menus[$i]["mod_modulecode"]) {
        if (authorize($menuRights[$j]["rr_create"]) || authorize($menuRights[$j]["rr_edit"]) ||
        authorize($menuRights[$j]["rr_delete"]) || authorize($menuRights[$j]["rr_view"]) ||
        authorize($menuRights[$j]["rr_balas"]) || authorize($menuRights[$j]["rr_terima"])
        ) {

        $row["menu"] = $menus[$i]["mod_modulegroupcode"];
        $row["menu_name"] = $menus[$i]["mod_modulename"];
        $row["page_name"] = $menus[$i]["mod_modulepagename"];
        $row["create"] = $menuRights[$j]["rr_create"];
        $row["edit"] = $menuRights[$j]["rr_edit"];
        $row["delete"] = $menuRights[$j]["rr_delete"];
        $row["view"] = $menuRights[$j]["rr_view"];
        $row["balas"] = $menuRights[$j]["rr_balas"];
        $row["terima"] = $menuRights[$j]["rr_terima"];

        $data[$menus[$i]["mod_modulegroupcode"]][$menuRights[$j]["rr_modulecode"]] = $row;
        $data[$menus[$i]["mod_modulegroupcode"]]["top_menu_name"] = $menus[$i]["mod_modulegroupname"];
        }
        }
        }
        }

        return $data;
        }

        Script on file purchases.php :

        if ( authorize($_SESSION["access"]["INVT"]["PURCHASES"]["create"]) ||
        authorize($_SESSION["access"]["INVT"]["PURCHASES"]["edit"]) ||
        authorize($_SESSION["access"]["INVT"]["PURCHASES"]["view"]) ||
        authorize($_SESSION["access"]["INVT"]["PURCHASES"]["delete"]) ||
        authorize($_SESSION["access"]["INVT"]["PURCHASES"]["balas"]) ||
        authorize($_SESSION["access"]["INVT"]["PURCHASES"]["terima"]) ) {
        $status = TRUE;
        }

        EDIT

        VIEW

        DELETE

        BALAS

        TERIMA

        If logged in as superadmin level,
        Which appears only edit, view, delete.
        Being BALAS and TERIMA not showing.

        What’s wrong with where?
        Thank you very much

      • Sorry, its code is not showing .

        purchases.php
        ————-

        if ( authorize($_SESSION[“access”][“INVT”][“PURCHASES”][“create”]) ||
        authorize($_SESSION[“access”][“INVT”][“PURCHASES”][“edit”]) ||
        authorize($_SESSION[“access”][“INVT”][“PURCHASES”][“view”]) ||
        authorize($_SESSION[“access”][“INVT”][“PURCHASES”][“delete”]) ||
        authorize($_SESSION[“access”][“INVT”][“PURCHASES”][“balas”]) ||
        authorize($_SESSION[“access”][“INVT”][“PURCHASES”][“terima”]) ) {
        $status = TRUE;
        }

        if (authorize($_SESSION[“access”][“INVT”][“PURCHASES”][“edit”])) {
        EDIT
        }
        if (authorize($_SESSION[“access”][“INVT”][“PURCHASES”][“view”])) {
        VIEW
        }
        if (authorize($_SESSION[“access”][“INVT”][“PURCHASES”][“delete”])) {
        DELETE
        }
        if (authorize($_SESSION[“access”][“INVT”][“PURCHASES”][“balas”])) {
        BALAS
        }
        if (authorize($_SESSION[“access”][“INVT”][“PURCHASES”][“terima”])) {
        TERIMA
        }

  30. Hi Shahrukh,
    I am basically a kid and i have my project in which i need to have a login page and i dont even know php so could u please tell me how to open this file.

  31. Thank You Mr. Shahrukh for sharing a good work. I also need this and I will try with your work. If I face any problems I will contact you.

  32. HI shahrukh,

    i am getting error while i trying to module name.can you please help us.

    Error Code: 1452
    Cannot add or update a child row: a foreign key constraint fails (multi-admin.role_rights, CONSTRAINT role_rights_ibfk_2 FOREIGN KEY (rr_modulecode) REFERENCES module (mod_modulecode) ON UPDATE CASCADE)

    INSERT INTO module (mod_modulegroupcode, mod_modulegroupname, mod_modulecode, mod_modulename, mod_modulegrouporder, mod_moduleorder, mod_modulepagename) VALUES
    (“INVT”,”reports”, “reports1″,”Purchases”, 2, 1,’import.php’),
    (“INVT”,”reports”, “reports2″,”Stocks”, 2, 2,’stocks.php’),
    (“INVT”,”reports”, “reports3″,”Sales”, 2, 3,’sales.php’),
    (“CHECKOUT”,”Checkout”,”SHIPPING”,”Shipping”, 3, 1,’shipping.php’),
    (“CHECKOUT”,”Checkout”,”PAYMENT”,”Payment”, 3, 2,’payment.php’),
    (“CHECKOUT”,”Checkout”,”TAX”,”Tax”, 3, 3,’tax.php’);

    INSERT INTO role_rights (rr_rolecode, rr_modulecode, rr_create, rr_edit, rr_delete, rr_view) VALUES
    (‘SUPERADMIN’, ‘reports1’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),
    (‘SUPERADMIN’, ‘reports2’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),
    (‘SUPERADMIN’, ‘reports1’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),
    (‘SUPERADMIN’, ‘SHIPPING’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),
    (‘SUPERADMIN’, ‘PAYMENT’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),
    (‘SUPERADMIN’, ‘TAX’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),
    (‘SUPERADMIN’, ‘REPORT’, ‘yes’, ‘yes’, ‘yes’, ‘yes’),

  33. Sir,
    I am new in php. I downloaded your code. While running, a message shows that ‘Warning: Invalid argument supplied for foreach() in C:\wamp\www\shahrukh\dashboard.php on line 69 and ‘Warning: Invalid argument supplied for foreach() in C:\wamp\www\shahrukh\dashboard.php on line 95’. What is the solution?
    Thank you.

  34. Sir,
    I am new in programming. I downloaded your code and tried to run. A message shows that
    1. SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘multi-admin.module.mod_modulegroupname’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
    2. Warning: Invalid argument supplied for foreach() in C:\wamp\www\shahrukh\dashboard.php on line 69
    3. Warning: Invalid argument supplied for foreach() in C:\wamp\www\shahrukh\dashboard.php on line 95.
    4. I have seen above the same query made by someone on January 6, 2017 1:12 AM but no answer was given.
    5. As I am new in programming, it is requested to explain why ‘wherre 1 order by —-‘ is used in the query:-
    $sql = “SELECT mod_modulegroupcode, mod_modulegroupname, mod_modulepagename, mod_modulecode, mod_modulename FROM module ”
    . ” WHERE 1 ”
    . ” ORDER BY mod_modulegrouporder ASC, mod_moduleorder ASC “;used at lines 23-25 in dashboard.php.
    Thanking you.

      • Dear sir,
        Reference: In continuation of the query made by me on 13/08/2017 that is showing just above, it is to state that
        first of all, I have not changed your database as well as your programme
        and secondly, my php is 5.7 wherein this type of issue continuously are shown. Please rectify your programme as per php 5.7 and latest versions.
        Thanking you.

Leave A Reply

CommentLuv badge

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.