View Single Post
Old 03-04-2005, 11:15 PM  
SMG
Confirmed User
 
Join Date: Aug 2003
Posts: 1,798
I'd do something like this (but backup first)

$rs = mysql_query("SELECT id, url FROM your_table ORDER BY id ASC");
while (list($id,$url)=mysql_fetch_row($rs)) {
mysql_query("DELETE FROM your_table WHERE url = '$url' AND id != '$id'");
}

that will go through all your rows and delete all duplicates other than the first one ... you could change ASC to DESC to make it delete all but the newest ... obviously you have to probably change the field and table names though.
__________________
TGP Webmasters: sign up for the top 100 tgp list!
Submit galleries
If you add me to icq (title) make sure to mention GFY or I'll think you're a bot and deny you.
SMG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote