v2.5.2
Giriş yap

Last Id Sıfır Geliyor

samkofte
723 defa görüntülendi
$query = $db->from('uyeler')
  ->orderby('uye_id', 'asc')
  ->all();

if ($query) {
  foreach ($query as $row) { }
}
 <div class="d-flex border-md-right flex-grow-1 align-items-center justify-content-center p-3 item">
 <i class="mdi mdi-currency-usd mr-3 icon-lg text-danger"></i>
<div class="d-flex flex-column justify-content-around">
<small class="mb-1 text-muted">Uyeler</small>
 <h5 class="mr-2 mb-0"><?= $db->lastId(); ?></h5>
</div>
</div>

Sıfır olarak yazdırıyor

tayfunerbilen
1619 gün önce

Yani doğal olarak 0 gelir. Insert işlemi olduğunda lastId() değer döndürür, sen herhangi bir insert işlemi yapmıyorsun :)