Hi everyone, I'm new here and fairly new to PHP. My question is, I have a vote system in WordPress that uses JavaScript to set a cookie that will disable the vote button for a specified period of time and I use PHP to send the voter's IP to a database. How can I set that IP to be deleted from the database after a specified period of time (10 seconds, 1 day, 1 week, or whatever) from the initial vote?
Thanks to anyone for any help!
Delete IP After Set Time
Moderator: General Moderators
Re: Delete IP After Set Time
You could add an expiry datetime column to the table and create a trigger to delete expired entries.
Re: Delete IP After Set Time
I'm not sure how to begin this process. Any code snippets to get the ball rolling?Celauran wrote:You could add an expiry datetime column to the table and create a trigger to delete expired entries.