MySQL auto delete if more than 5 rows
#1

Okay, I want to keep records of the last 5 people the person called, but I don't want useless rows in my database either.

I stumbled upon "Trigers" in MySQL, so is it possible to add a trigger AFTER "Insert" queries that would delete the oldest row(I keep the current timestamp when they are added).

Note: I know this is more MySQL related than Pawn, but I'm still posting this here to let people suggest other ways and etc.

I know I could just send a query AFTER the insert one, to count the rows and delete the last one, but I just want to know if my described way is possible.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)