// codeigniter 4 limit query
// getting data from model
$data['dataName'] = $account->where('role', 'User')->orderBy('created_at', 'DESC')->limit(5)->find();
// codeigniter 4 limit query displaying data
<ul class="products-list product-list-in-box">
<?php foreach ($dataName as $dataNames) : ?>
<li class="item">
<div class="data-img"> <img src="/uploads/<?= $dataNames['img'] ?>" alt="Data Image"> </div>
<div class="data-info"> <a href="#" class="product-title"><?= $dataNames['first_name'] . " " . $topsellers['last_name'] ?>
</a> <span class="data-description"> <a href="#"><?= $dataNames['email'] ?></a>
</span>
</div>
</li>
<?php endforeach; ?>
</ul>