In general, to compare a row with the previous one, store the previous row's value in a variable. Make sure to assign the variable with a value that won't occur as a real value in your data.
$prevValue = NULL;
while(condition) {
if ($curValue == $prevValue) {
.
. do stuff
.
}
$prevValue = $curValue;
}
0 Comments