How to get second last row from a mysql database?
SELECT * FROM Categories ORDER BY CategoryID DESC LIMIT 1,1
SELECT * From
(select * from Categories ORDER BY CategoryID DESC LIMIT 2) AS x
ORDER BY CategoryID LIMIT 1
I think you need something like this SELECT * from Categories ORDER BY CategoryID DESC LIMIT 1, 1