MySQL – Auto delete a record in table when date is expired

It’s possible by Event Scheduler

CREATE EVENT IF NOT EXISTS `[database_name]`.`[event_name]` ON SCHEDULE EVERY 30 SECOND
 DELETE FROM `[database_name]`.`[table_name]` WHERE `create_on` < NOW()-INTERVAL 60 SECOND;

The above run for every 30 seconds and will delete the records where created_on is less then 60 seconds on every trigger of this event.

Make sure Event Scheduler should be enabled on your server.

 SET GLOBAL event_scheduler = ON;

Codeigniter 2 on IIS with web.config file

<code><?xml version="1.0" encoding="UTF-8"?>
 <rule name="Rewrite to index.php">
 <match url="index.php|robots.txt|images|test.php" />
<action type="None" />
<rule name="Rewrite CI Index">
<match url=".*" />
<add input="{REQUEST_FILENAME}" pattern="css|js|jpg|jpeg|png|gif|ico|htm|html" negate="true" />
<action type="Rewrite" url="index.php/{R:0}" />

Ref :