You need to create a MySQL query: "Select in the reverse order m records from the database, starting with n records".
Posted by:
SELECT * FROM items WHERE id > $pos ORDER BY id DESC LIMIT 5 But I think that it is not worth writing this way, and there is a more correct form of request.
idfield. If you need to select the first five lines, theidwhich is greater than a certain value and which have the maximumidamong all the records found, then this query should be. - Regentidand take 5 records from 10 places, andWHERE id > $posused as a crutch for this, you can change the query forSELECT * FROM items ORDER BY id DESC LIMIT 9, 5- Regent