如何检查while循环中的结果行值是否相同,我需要在所有结果中完成状态时更新...
tag
答案 0 :(得分:0)
相反,我可以在其中使用break条件:
while($row = $db->fetchRow($result)){
$staff_id=$row['id_c'];
$result1 = $db->query("SELECT `status` FROM `fy_working_staf` WHERE id='".$staff_id."' AND `status`='Completed'");
$staf = $db->fetchByAssoc($result1);
$status = $staf['status'];
if($stat!='Completed')
{
$comple_staus='Closed_Closed';
break;// will exit the loop when the row is not same
}
}