if you want to do something based on the fact that the data is the same in the next row, then looking ahead is easy with this.
<?php
$i=0;
$rows=mysql_num_rows($result);
while($i < $rows) {
$x = mysql_result($result, $i, 0);
if ($x = mysql_result($result, $i+1, 0)) {
echo "It's the same thing!";
}
}
?>