All I want to do is to get saved operator from database and used it in if else condition. Here is my code. It always return true. Not able to figure out what I am doing wrong
$sql_c = "select cc.operator, cc.dpt_id, dp.dpt_value as value from criteria_condition cc
join decision_point_type dp on cc.dpt_id = dp.dpt_id where criteria_id = $nodecriteria";
$res_c = mysql_query($sql_c);
while($row = mysql_fetch_array($res_c)){
$operand = $row['operator'];
$dpt_value = $row['value'];
}
echo "'$userinput'".$operand ."'$dpt_value'".'<br>';
if("'$userinput'".$operand."'$dpt_value'"){
echo 'true';
}else{
echo 'false';
}
Echo displays "hello"==="hello" but in if condition it is not work properly