Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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