Reg Web Posted October 29, 2006 Share Posted October 29, 2006 Hi there!I am looking for a script which will enable me to tell the MySQL table to automatically delete a row upon a certain date and time.Is this possible? Quote Link to comment Share on other sites More sharing options...
paul2463 Posted October 29, 2006 Share Posted October 29, 2006 yesyou write a php script that will check over the database to delete all the rows you want it to such as:-code for deleteRows.php[code]<?php$connection = mysql_connect('localhost', '*****', '*****');mysql_select_db('table');$query = "DELETE FROM table WHERE "delete parameters are met";mysql_query($query)or die ('Error in query: $query. ' . mysql_error());?>[/code]then set up a cron job on your server to run the script when you want it running, once a day , once an hour or whatever Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.