public function getRoleAndUserFromIdUser($userId) {
        $sql = 'SELECT
                    user.username,
                    user.id_user,
                    role.name,
                    role.id_role,
                    role.id_parent,
                    NOW() AS db_date
                FROM
                    role
                        INNER JOIN
                    user ON user.id_role = role.id_role
                WHERE user.id_user="'.$userId.'"
                 ';
        $role = $this->select($sql);
        if(is_array($role) && count($role)>0) {
            return $role[0];
        } else {
            return false;
        }
    }
public function getRoleAndUserFromIdUser($userId) {
        $sql = 'SELECT
                    user.username,
                    user.id_user,
                    role.name,
                    role.id_role,
                    role.id_parent,
                    NOW() AS db_date
                FROM
                    role
                        INNER JOIN
                    user ON user.id_role = role.id_role
                WHERE user.id_user="'.$userId.'"
                 ';
        $role = $this->select($sql);
        if(is_array($role) && count($role)>0) {
            return $role[0];
        } else {
            return false;
        }
    }
public function getRoleAndUserFromIdUser ( $ userId ) { $ sql = 'SELECT
                    user.username,
                    user.id_user,
                    role.name,
                    role.id_role,
                    role.id_parent,
                    NOW() AS db_date
                FROM
                    role
                        INNER JOIN
                    user ON user.id_role = role.id_role
                WHERE user.id_user="' . $ userId . '"
                 ' ; $ role = $ this -> select ( $ sql ) ; if ( is_array ( $ role ) && count ( $ role ) > 0 ) { return $ role [ 0 ] ; } else { return false ; } }
Return user information given id user.

@param int $userId

@return array
Return user information given id user .