Jump to content

jwalling

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jwalling's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for your code suggestion. I already see some useful tidbits. John
  2. Since my PHP proficiency is limited to adapting examples, would you give one for this suggestion? Thanks, John
  3. The following information may be relevant to the problem of updating duplicates. I would like to see some example code that works around the Syntax contstraints. -jw-
  4. 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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.