Forum Moderators: coopster
$sql = "select count(col1) as ccols,col1,col2 from table_1";
$result = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_array($result)) {
if($row['ccols'] > 1) {
$newsql = "delete from table_1 where col1 = $row['col1'] and col2 = $row['col2] limit
$row['ccols']-1";
mysql_query($newsql);
}
}
You could try this; I haven't, but i hope it helps. Good luck!
eelix