Try using a for
loop instead:
$t = 1;
for($i = 0, $numRecords = sizeof($getAllDetails), $i < $numRecords; ++$i) {
if ($getAllDetails[$i][0] != $t) {
echo '<b>'.$t.'.---------------------------------</b><br>';
// you can change the value of $i here to step back (i.e. --$i)
} else {
?>
<b>
<?php
echo $getAllDetails[$i][0].'. '. $getAllDetails[$i][10].', '.$getAllDetails[$i][2].', '.$getAllDetails[$i][11].', '.$getAllDetails[$i][12].', '.round($getAllDetails[$i][6],1).'%, '.$getAllDetails[$i][8].'oz, $'.round($getAllDetails[$i][5]);
?>
</b>
}
}