Hallo,
I have table user like this :
CREATE TABLE users
(
EmployeeID
INT(11) NOT NULL AUTO_INCREMENT,
LastName
VARCHAR(20) NULL DEFAULT NULL,
FirstName
VARCHAR(10) NULL DEFAULT NULL,
Email
VARCHAR(30) NULL DEFAULT NULL,
Photo
VARCHAR(255) NULL DEFAULT NULL,
Password
VARCHAR(50) NOT NULL DEFAULT '',
Sex
VARCHAR(1) NULL DEFAULT NULL,
UserLevel
INT(11) NULL DEFAULT NULL,
Username
VARCHAR(20) NOT NULL DEFAULT '',
Activated
ENUM('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (EmployeeID
),
UNIQUE INDEX Username
(Username
)
)
COLLATE='utf8_general_ci'
ENGINE=MyISAM
ROW_FORMAT=DEFAULT
AUTO_INCREMENT=10
Example if i used this function :
function TablePermission_Loading() {
if (CurrentUserName() == "nancy")
$this->AddUserLevel("Manager");
}
this is can work well.
but i want to add user level is based "Sex" , so that i add userlevel is "Male" and this function become :
function TablePermission_Loading() {
if (CurrentUserInfo("Sex") == "1") //assumed value "1" is male
$this->AddUserLevel("Male");
}
but can't work.
is there someone who can help me?
Thank You very much.