CI_DB_result::previous_row PHP Method

previous_row() public method

Returns the "previous" row
public previous_row ( string $type = 'object' ) : mixed
$type string
return mixed
    public function previous_row($type = 'object')
    {
        $result = $this->result($type);
        if (count($result) === 0) {
            return NULL;
        }
        if (isset($result[$this->current_row - 1])) {
            --$this->current_row;
        }
        return $result[$this->current_row];
    }