[Solved] Output last 5 rows in database [CakePHP] [closed] December 23, 2022 by Kirat [ad_1]You have to use find()Other way is to use query()$alltext = $this->Text->find('all', array('limit' => 5,'order'=>array('id DESC'))); <?php foreach ($alltextext as $text): ?> // format as necessary <td><?php echo $text['Text']['id']; ?></td> // add others here <?php endforeach; ?> 3[ad_2]solved Output last 5 rows in database [CakePHP] [closed]