NameSilo

Would this work?

Spaceship Spaceship
Watch

Barrucadu

Established Member
Impact
64
What this script is supposed to do is delete all articles older than 60 days, would it work?

PHP:
$killdate = date("d-m-Y")-60;
mysql_connect("---Server---","---Username---","---Password---") or die(mysql_error());
mysql_select_db("---Database---") or die(mysql_error());
mysql_query("DELETE FROM `MyPhpArticle` WHERE `date` <= ".$killdate."") or die(mysql_error());
mysql_close();
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
It should work. Just for your information, it will delete any column created 60 days old, irrespective of posts, settings or other data, so when you replace "MyPhpArticle" variable with the table you want to clean up, make sure it has nothing else except post data.
I would recommend that you play with it little bit on dummy databases before actually putting it to any use.
 
0
•••
So it'll delete all entries in the database older than 60 days?
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back