I have a table in database which records ip addresses
i need to have a maximum o 100 records for each user then delete the last record if the user reaches 100 records and add the new record to the top (newest)
what is the best method to do this with PHP or MYSQL QUERY, should i use num_rows
with SELECT *
?
EDIT: I need to limit recording IPs for each user in database, not limit showing them (each user can't have more than 100 IPs in database)
EDIT 2: I was thinking of reading the date of 100th query and then delete each record with date < 100th query, is this a good practice?