This topic is locked
[SOLVED]

 If ..else in php

9/15/2019 5:47:42 AM
PHPRunner General questions
A
AndrewMark author

In before record added I have inserted the below code.

The problem I'm having is that when I input a "no" in the field IsSubjectEntitydifferent, the field CommEntity receives the values of $entityyes, instead of $nothingnoted.

Something must be wrong in my syntax, but not sure what. Please assist if possible.
$nothingnoted="No comments applicable";

$entityyes = "The entity provided by the subject was ".$values['SubjectName1']."They have informed us that this is a different entity to the original requested entity ".$values['RequestedEntityName'];

$CtrlIsSubjectEntitydifferent= $value['IsSubjectEntitydifferent'];

if($CtrlIsSubjectEntitydifferent="yes"){

$values['CommEntity'] = $entityyes;

}else {

$values['CommEntity'] = $nothingnoted;

}

lefty 9/15/2019



In before record added I have inserted the below code.

The problem I'm having is that when I input a "no" in the field IsSubjectEntitydifferent, the field CommEntity receives the values of $entityyes, instead of $nothingnoted.

Something must be wrong in my syntax, but not sure what. Please assist if possible.
$nothingnoted="No comments applicable";

$entityyes = "The entity provided by the subject was ".$values['SubjectName1']."They have informed us that this is a different entity to the original requested entity ".$values['RequestedEntityName'];

$CtrlIsSubjectEntitydifferent= $value['IsSubjectEntitydifferent'];

if($CtrlIsSubjectEntitydifferent="yes"){

$values['CommEntity'] = $entityyes;

}else {

$values['CommEntity'] = $nothingnoted;

}


[color="#1C2837"]

A
AndrewMark author 9/15/2019

thanks, will try this