var_dump($managerId);echo"<br>"; while($row = $result->fetch()){ var_dump(intval($row['manager_id'])); if(intval($row['manager_id'])===$managerId){break;} else{$managerId=false;} } Conclusion:
The first var_dump() : int (6)
In the loop:
int(2) int(3) int(4) int(5) int(6) int(7) int(8) int(9) int(10) int(11) int(12) int(13) int(33) int(125) int(128) I see a coincidence. Why doesn't the if condition work?