Published in: PHP
$duplicates checks and groups duplicated rows with the same field1 and field2 (like comments maybe) and $limit counts how many times a row is duplicated.
<?php $duplicates = mysql_query("SELECT field1, field2, count(*) FROM table GROUP BY field1, field2 having count(*) > 1"); if ($count > 0) { $field = $row["field1"]; $limit = $row["count(*)"] - 1; } } ?>
You need to login to post a comment.
