Just use math to manipulate the row index you are trying to achieve (i believe this is what you're trying to do).
So if your
limit $startLim, $endLim, for example
$startLim = 30; $endLim = 50, that gives you 20 rows, to get
$i to start at 30,
$i = $startLim - which lets you use loops easier
Again - Not sure what your problem is