Jump to content

[SOLVED] mysql auto remove


dezkit

Recommended Posts

Depends on your host as to how to setup a cron job, or if you're even allowed to.  I suggest you talk to them about that.  But if you have cpanel there is an icon for setting up a cron job (again, assuming your hosting plan allows cron jobs).  Follow the instructions.  As far as the script you want the cron job to run every x amount of time, it can be something as simple as

 

<?php
   $conn = mysql_connect('localhost','dbusername','dbpass');
   $db = mysql_select_db('dbname',$conn);

   mysql_query("delete from table where date_end > now()", $conn);
?>

   

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.