Thanks samuelcook,
My DB are:
TABLE USER contain fields: id, name, username, password, admin, date.
TABLE PERSON contain fields: id, dept_id, name, surname, address , email, mobile
TABLE DEPT contain fields: id, dept_name
Note: dept.id = person.dept_id
For those a new user they have to register first then once they log in it will redirect them to member-area page which contain create user details (name, surname, address, email, mobile) also they have to choose on the select option what dept are they.
Is my DB there is okay for creating an admin login? Do I have to set the value for admin as 1 and user = 0? or something? There is only one admin here but can be alot of user.
Please explain to me if the code above will work on this. Thanks.