I created a site (two actually) in September of 2002 using a dmoz import. I would like to do a new dmoz import, but would like to delete first ONLY the links that were imported and never modified since import. I have an active user base now that maintains their own links, but also have hundreds of dead links. Is there a way to do a mysql search on add date=something and mod date=same something and then delete them? I can't delete all links that have never been modified, only ones added on specific dates.
Jun 8, 2005, 11:45 PM
Veteran / Moderator (17298 posts)
Jun 8, 2005, 11:45 PM
Post #2 of 3
Views: 296
Hi,
Should be simple.
SELECT MIN(ID) FROM lsql_Links;
...then, once you have that ID...
SELECT Add_Date FROM lsql_Links WHERE ID = 1234
SELECT ID,Add_Date FROM lsql_Links WHERE Add_Date = "2002-05-02" AND Mod_Date = "2002-05-02"
..and once your happy with those results, try;
DELETE FROM lsql_Links WHERE Add_Date = "2002-05-02" AND Mod_Date = "2002-05-02"
Hope that helps
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Should be simple.
SELECT MIN(ID) FROM lsql_Links;
...then, once you have that ID...
SELECT Add_Date FROM lsql_Links WHERE ID = 1234
SELECT ID,Add_Date FROM lsql_Links WHERE Add_Date = "2002-05-02" AND Mod_Date = "2002-05-02"
..and once your happy with those results, try;
DELETE FROM lsql_Links WHERE Add_Date = "2002-05-02" AND Mod_Date = "2002-05-02"
Hope that helps
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

