Lookup_Selecting with 2 or 3 filter

is it possible to filter with criteria and.
example
function Lookup_Selecting($fld, &$filter) {
$dept = ExecuteScalar(“SELECT departement FROM user WHERE username= '”.CurrentUserName().“'”);
//$div = ExecuteScalar(“SELECT divisi FROM user WHERE username= '”.CurrentUserName().“'”);
$name = ExecuteScalar(“SELECT nama_pt FROM user WHERE username= '”.CurrentUserName().“'”);

if ($fld->Name == “nama”)
$fld->Lookup->UserFilter = “departemen = ‘$dept’” and “nama_pt = ‘$name’” ; // Assume the field is of string type
//var_dump($fld->Name, $fld->Lookup, $filter);

im try not work.
is there any advice?
thanks

newbiephp wrote:

$fld->Lookup->UserFilter = “departemen = ‘$dept’” and “nama_pt = ‘$name’” ; // Assume the field is of string type

You have wrong string syntax.

where is wrong? Can you help?
thanks

arbei wrote:

You have wrong string syntax

$fld->Lookup->UserFilter = “string1” and “string2”;

See also: https://www.php.net/manual/en/language.types.string.php.

oke thanks