Hi all. I have a mail system on y website , but I want a number of maximum mail in their account.
The tables works like this :
Table mail : The id of the message , author , subject , date and content.
Table mail_link : The player id (to message) , message_id (the id of the message in table mail) and read ( if user have read or not the messgae)
When a user send a message to someone, the message info is stored in the mail table. Then , it adds the id of the player that will receive the message and the id of the message in mai_link.
I want to call a function named CleanMailBox everytime a user send a message , this function will check the guy that will receive the message if he has the maximum messages autorised. If so , I want the script to delete the oldest entry to let space for the new one.
The tables works like this :
Table mail : The id of the message , author , subject , date and content.
Table mail_link : The player id (to message) , message_id (the id of the message in table mail) and read ( if user have read or not the messgae)
When a user send a message to someone, the message info is stored in the mail table. Then , it adds the id of the player that will receive the message and the id of the message in mai_link.
I want to call a function named CleanMailBox everytime a user send a message , this function will check the guy that will receive the message if he has the maximum messages autorised. If so , I want the script to delete the oldest entry to let space for the new one.