Jump to content

Merging Duplicates?


mikedag

Recommended Posts

Hi,

 

I am working with a "directory" site that I did not originally develop... The database contains roughly 50,000 records and out of the 50,000 roughly 20,000 are in a sense, duplicates... Each user(row) was listed under a "category" and the table holding them only had one column for "categoryid".... The problem is that if the user wanted to be listed under a different category the record was duplicated and the only things that changed was the "categoryid", and of course the row "ID"....

 

I have modified scripts and the table to now hold multiple categoryid's so that the record only needs to be entered once and will show under multiple categories....

 

The problem i'm facing is, is there any easier way than doing it manually to merge the categoryid's into one row and remove the duplicate records? For example, say the original rows looks like this:

 

ID | NAME | INFO | CATEGORYID1

 

and the new ones look like this:

 

ID | NAME | INFO | CATEGORYID1 | CATEGORYID2 | CATEGORYID3

 

How can I grab one of the originals and then take and move the other duplicates categoryid's into CATEGORY2, CATEGORY3?

 

I know this was probably extra confusing... Welcome to the club! I'm so confused I'm pulling out the little hair I have left!

 

Mike

Link to comment
https://forums.phpfreaks.com/topic/178473-merging-duplicates/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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