Hey all -
I'm trying to implement a basic log in a table. Instead of writing to a text
file on the server, I want to insert entries into a 'log' table. However, I
want to limit this table to only have the last 500 rows or so. How do I do
this?
Here's my pseudocode, but it seems as if there would be a better way:
logEntry($message){
insert message into table
get number of rows in table
if (numrows > 500){
delete from table where ((numrows - id) > 500)
}
}
Is that right??
Thanks,
Shane