Access current row and previous row

Permalink
Hi all,

I have tried my hand at creating a customised block using the core 5.7 FAQ block (allows me to repeatable items). I have it all working nicely... YAY for me however now I'm working on the view.php.

I can get a foreach statement working for one section, I can also just echo out the most recent row from the table however I have a need to also echo out the second most recent row and have no idea where to start.

As new rows will continually be added, the need will arise to simple access the most recent and the second most recent row if possible?

Any help would be greatly appreciated.