Something like this would probably do it:
<?php
$rank = 0;
$lastVal = -1;
$skipped = 0;
?>
<?php
$wa_startindex = 0;
while(!$rsLists->atEnd()) {
$wa_startindex = $rsLists->Index;
if ($lastVal != $rsLists->getColumnVal("Quantity")) {
$lastVal = $rsLists->getColumnVal("Quantity");
$rank += $skipped + 1;
$skipped = 0;
} else {
$skipped++;
}
?>
<tr>
<td><?php echo($rank); ?></td>
<td><?php echo($rsLists->getColumnVal("Quantity")); ?></td>
<td><?php echo($rsLists->getColumnVal("FullName")); ?></td>
</tr>
<?php
$rsLists->moveNext();
}
$rsLists->moveFirst(); //return RS to first record
unset($wa_startindex);
unset($wa_repeatcount);
?>