morteza jamaseb Wed Mar 02 03:16:15 -0500 2016

Subject: Get last n record of table

Hi , I'm new in PHP Active record . is there any method to get last n record in php AR ?
tnx


Alexander Matrosov Wed May 18 15:12:32 -0400 2016

example

<?php
$guest = new Guestbook();
$guest->token = Request::input('token', true);
$guest->captcha = Request::input('captcha');
$guest->user_id = User::get('id');
$guest->text = Request::input('text');
$guest->ip = App::getClientIp();
$guest->brow = App::getUserAgent();

// after save
if ($guest->save()) {

//last insert id
var_dump($guest->id);

(1-1/1)