从一个数组列中查找数组值的匹配项

hello friends i have a code. i found matching of one array value in another array column and updated row with second array value. but i want to update status of first array record in mysql table with zero when no matches found.anybody knows please help. i will provide my code below

foreach ($result as $rel)
{
    foreach ($array as $arr)
    {
        if(strcmp(trim($rel['objId']),trim($arr['BCEID']))==0)
        {
            $name=$arr['FirstName'];
            $conditn=$rel['objId'];

            $sql1="UPDATE e_student SET Name = '$name' WHERE objId ='$conditn'";

            $result=$conn->query($sql1);
        }
    } 
}   
foreach ($result as $rel)
{
    $clk = 'no';
    foreach ($array as $arr)
    {
        if(strcmp(trim($rel['objId']),trim($arr['BCEID']))==0)
        {
            $clk = 'yes';
            $name=$arr['FirstName'];
            $conditn=$rel['objId'];

            $sql1="UPDATE e_student SET Name = '$name' WHERE objId ='$conditn'";

            $result=$conn->query($sql1);
        }
    } 
    if($clk=='no')
    {
        // write query here to set status 0
    }
}