its because the any of them is not true or both
you are using the &&/AND so both must be match since you are getting the else result it mean any of them is not equal or both
you can check this by below method
if($row_x['xfield']==$_POST['x1']){
echo ' xfiekd is = to x1';
if($row_x['yfield']==$_POST['y']){
echo ' yfiekd is = to y and aslo 1 is true';
}else{ echo 'y is false' }
}
else{
echo ' xfiekd is = to x1' is false;
if($row_x['yfield']==$_POST['y']){
echo ' yfiekd is = to y and aslo 1 is true';
}else{ echo 'y is false' }
}
to get in if function body on true at least one condition you need to use the || instead of the AND
difference betwen AND an OR
truth table for AND
a b
true true = true
true false = false
false false = false
false true = false
truth table for OR
a b
true true = true
true false = true
false true = true
false false = true
true false = true
echo $row_x['xfield']. '==' . $_POST['x1'];?ANDandORare able to be used in as operators, but&&and||have a higher order of priority.x1?