Get the last item from table

how do i get the last record add?

I’m using the code below. Is it correct or is there a simpler way?

$select = $this->getDbTable()->select()
     ->from('notafiscal', 'numbernf')
     ->order('numbernf DESC')
$result = $this->getDbTable()->fetchAll($select);


Is the column ‘numbernf’ a unique, auto-incrementing field?

At first glance, the code seems to be correct. Did you get any error message running the code?