|
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.
|