Efficiently store last X items in an MySQL Database
- by Saif Bechan
I want to store the last 3 items in an MySQL database in an efficient way. So when the 4th item is stored the first should be deleted.
The way I do this not is first run a query getting the items. Than check what I should do then insert/delete.
There has to be a better way to do this. Any suggestions?