How get the penultimate row at DB using active record?
I have the following statement:
$query = $this->db->get_where('sys_access', array('user' => $usid));
$ult_access = $query->last_row();
$this->data['ult_acsess'] = $ult_acsess->data;
This print in the view the last access at the system. But the last access is now (after login in the system), i need get the penultimate access.
I’m not 100% sure I understand your question but if I do you want the last access before your login? If so just query the database ordered by whatever you’re using to track, a time field, id etc then select the second record. IE: