Reputation: 5824
Is there a way to limit table to example 100 rows in with PHPmyAdmin or some query ?
Idea is if there is 100 rows and some script inserts new row, the oldest is discarded automatically.
Upvotes: 0
Views: 111
Reputation: 71384
PHPMyAdmin would have nothing to do with this. It is just a MySQL client UI and would have no way to operate on the MySQL database on it's own.
You could set up a trigger to do this, but I guess I would really wonder what you are gaining here. When querying the table you can always simply return only the 100 most recent rows. Unless your table is growing drastically, are you really going to impact query performance if the table has 200 rows instead of 100? It is highly doubtful if you are properly utilizing indexes on the table.
Upvotes: 2