Apache version 1.3.37 (Unix)
MySQL version 5.0.27-standard
PHP version 5.2.0
I want to update duplicate records in a Drupal database application by adding dupe count in each dupe record based on key [org_name+org_city].
I am able to list duplicates with this:
[snip]
$result = mysqli_query($db, 'SELECT org_name,org_city FROM content_type_resource GROUP BY org_name,org_city HAVING COUNT(*)>1');
while ($row = mysqli_fetch_object($result)) {
printf(
'<tr><td>%s</td><td>%s</td></tr>',
htmlspecialchars($row->org_name),
htmlspecialchars($row->org_city)
[/snip]
How can I add an update statement that accomplishes the following logic:
UPDATE content_type_resource SET org_dupe=count WHERE count > 1;
I might be able to use a temporary table, but my knowledge of PHP and MySQL is rudimentary.
Thanks in advance,
John