By ludovicsantaroni - Thu Jan 09, 2020 11:21 am
- Thu Jan 09, 2020 11:21 am
#827332
Hello everybody,
I have to calculate a specific variable for a user logged according to his groups of membership.
I try to do it with this code but $query1 part seams to doesn't work (if I replace $result1 by a list of group id in $query2, it works as I want).
$reglenommage="RVD_NAT_DA_H66";//namerule
$UserID=@@USER_LOGGED;//user_uid of user logged
$query1= "select distinct GRP_UID from GROUP_USER where USR_UID=$UserID";//groups of user logged
$result1= executeQuery($query1);
$query2= "select distinct GRP_TITLE, GRP_UID from GROUPWF where GRP_TITLE like '$reglenommage%' and GRP_UID in($result1)";//groups matching to namerule within groups of user logged
$result2=executeQuery($query2);
$GroupTitle=$result2[1]['GRP_TITLE'];//first result matching
$region = substr($GroupTitle, 11, 6);//truncate group name
@@INIT_CODE_REGION=$region;
Could you help me, please ?
I have to calculate a specific variable for a user logged according to his groups of membership.
I try to do it with this code but $query1 part seams to doesn't work (if I replace $result1 by a list of group id in $query2, it works as I want).
$reglenommage="RVD_NAT_DA_H66";//namerule
$UserID=@@USER_LOGGED;//user_uid of user logged
$query1= "select distinct GRP_UID from GROUP_USER where USR_UID=$UserID";//groups of user logged
$result1= executeQuery($query1);
$query2= "select distinct GRP_TITLE, GRP_UID from GROUPWF where GRP_TITLE like '$reglenommage%' and GRP_UID in($result1)";//groups matching to namerule within groups of user logged
$result2=executeQuery($query2);
$GroupTitle=$result2[1]['GRP_TITLE'];//first result matching
$region = substr($GroupTitle, 11, 6);//truncate group name
@@INIT_CODE_REGION=$region;
Could you help me, please ?