That's exactly what I showed you how to do.
all you have to do is keep track of $current (which is, surprise surprise - the current record). In other words, keep sending $current as a hidden variable. So, inaddition to the code I sent before, add something like this:
if($current) $current = $current+5;
else $current="0"
Is it that hard of a concept?