Hi,
I have an array which I loop through and within that loop look for results that match the first's values. I need to make sure that all of the matches to the first array are there and if so then write a status to another table. I don't know how many values there would be in the first array and the second array won't be in the same order. I am wondering if there is a better solution to this matching process, and even if this approach below may miss some iteration in the loop causing incorrect results?
while($get_duty_v_row = $get_duty_v->fetch(PDO::FETCH_ASSOC)){
//get the first record
$value1 = $get_duty_v_row['value1'];
while($and_duties_row = $and_duties->fetch(PDO::FETCH_ASSOC)){
$value2 = $and_duties_row['value2'];
if($value1 !== $value2){
//values don't match, move on
$error[] = "set";
}
}
if(empty($error)){
write to table
}
}
Thanks,
G