döngünün önüne;
$say = 0
ekleyin, döngünün içine ise;
$say++
ekleyin daha sonra $say ile sıralamayı yazdırırsınız.
Tam anlamadım şu kod üzerinden örnek verebilir misiniz hocam
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header card-header-primary">
<h4 class="card-title ">İşlem Geçmişi</h4>
<p class="card-category"> Burada gerçekleştirdiğiniz son 10 işlemi görüntüleyebilirsiniz.</p>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table">
<thead class=" text-primary">
<th>
ID
</th>
<th>
Tutar
</th>
<th>
Yapılan İşlem
</th>
<th>
Kullanıcı
</th>
<th>
İşlem Zamanı
</th>
</thead>
<tbody>
<?php
$db->exec("SET names utf8");
$sqlQuery = "SELECT * FROM gecmis WHERE user_id = :id ORDER BY id DESC LIMIT 10";
$statement2 = $db->prepare($sqlQuery);
$statement2->execute(array(':id' => $id));
while($rs2 = $statement2->fetch()){
$gecmisid = $rs2['id'];
$gecmisuser_id = $rs2['user_id'];
$gecmistutar = $rs2['tutar'];
$gecmisislem = $rs2['islem'];
$gecmiszaman = $rs2['zaman'];
$gecmisuser_name = $rs2['user_name'];
$gecmistype = $rs2['type'];
?>
<tr>
<td>
<?php if (isset($gecmisid)) echo $gecmisid; ?>
</td>
<td>
<?php if (isset($gecmistutar)) echo $gecmistutar; ?> <?php if ($gecmistype== "TL") { echo '₺'; } else { echo '$ '; } ?>
</td>
<td>
<?php if (isset($gecmisislem)) echo $gecmisislem; ?>
</td>
<td>
<?php if (isset($gecmisuser_name)) echo $gecmisuser_name; ?>
</td>
<td class="text-primary">
<?php if (isset($gecmiszaman)) echo $gecmiszaman; ?>
</td>
</tr>
<?php
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>Mesela bunda örnek vermek gerekirse?