Asi lo podrias hacer dinamico.
Código PHP:
//contamos las filas de la tabla
$registro=mysql_query("select count(*) from TABLA");
$r=mysql_fetch_array($registro);
//$r['count(*)'] contendra el numeto de filas
$registro=mysql_query("select * from
TABLA
LIMIT 1
OFFSET ".($r['count(*)'] - 1)."
");
while($r=mysql_fetch_array($registro)){
echo $r['CAMPO'];
}
//el ultimo elemento menos 1 es el anteultimo elemento
//($r['count(*)'] - 1)