Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Products doubled in database


kunal247

Recommended Posts

Posted

I had 6000 products in my database after updating some products realised that now my database has 12000 products.

 

is there a way to delete the double entrys from my database?

how can I do this in myPHP

 

i have been trying to delete these products but one by one will take for ever is there a code that can be used to delete products from mySQL?

 

appreciate your help

Kunal

Posted

Before you go trying to remove things, make a backup right now. Then, try to figure out how you ended up with your current products duplicated. That's your biggest problem - if something went wrong to just duplicate that many products, it can go wrong again.

Contributions

 

Discount Coupon Codes

Donations

Posted
Before you go trying to remove things, make a backup right now. Then, try to figure out how you ended up with your current products duplicated. That's your biggest problem - if something went wrong to just duplicate that many products, it can go wrong again.

Thanks for your advice.

I have just done what you have sugested.

 

Now looking for a solution.

Hope some one can help me

 

Kunal :(

Posted

can you tell as of which products_id you have duplicates ?

and is everything created afterwards a duplicate, or do you have genuinely new/unique products in that id range ?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Posted
can you tell as of which products_id you have duplicates ?

and is everything created afterwards a duplicate, or do you have genuinely new/unique products in that id range ?

Looking in to the SQL database it seems like it has created new product id's

I have deleted the products from the admin interface and the duplicate products are not being displayed in the Live shop, but under Admin on the Home Page of Admin under products it states Products: 12000

 

Also the products are still visable in the SQL database.

This is so odd and dont know how to go about correcting this.

 

Just realised (I am assuming) that because of such a large number of products I cant use easy populate to download a feed as the server seems to be timing out.

 

Any advice and help is appreciated

Kunal

Posted

it sounds like the products where added for another language.

 

Can you check the products_description table for duplicates in another language ?

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Posted

12,000 products is not a lot for a mysql database to handle.

 

You still haven't said how the products got duplicated. I assume you figured that part out. You see, it's not easy to know how to tell you what SQL statements to run without knowing what happened. I agree, deleting 6000 products by hand is quite tedious.

 

You said you can see the duplicate products in the admin section. Are they assigned to categories? Are the categories duplicated?

 

Do the duplicates only show in the products table, or are they duplicated in the products_description table as well? If they are only in the products table, and not the products_description table, then you have an easy way to know which ones to delete in a SQL statement.

Contributions

 

Discount Coupon Codes

Donations

Posted
it sounds like the products where added for another language.

 

Can you check the products_description table for duplicates in another language ?

All products seem to be in Language 1

For my site that is English.

 

Is there a code or a way to delete multiple product id's in SQL?

 

Kunal

 

12,000 products is not a lot for a mysql database to handle.

 

You still haven't said how the products got duplicated. I assume you figured that part out. You see, it's not easy to know how to tell you what SQL statements to run without knowing what happened. I agree, deleting 6000 products by hand is quite tedious.

 

You said you can see the duplicate products in the admin section. Are they assigned to categories? Are the categories duplicated?

 

Do the duplicates only show in the products table, or are they duplicated in the products_description table as well? If they are only in the products table, and not the products_description table, then you have an easy way to know which ones to delete in a SQL statement.

Thanks for your feedback.

I am able to recognise some of the products but not sure about all of them.

I know for a fact that I had about 6000 products but the next day when I loged into SQL database noticed i HAD 12000

 

as of now I can see the products only in the products table and not in products_descriptions

 

hope this helps.

Posted

Okay, if the duplicated products are in the products table, and not the products_description table, then there should be no language_id. It is stored in the products_description table. I just want to be clear on what you're saying.

 

Find a product that is duplicated. From what I understand, you will see a product with all the same information except products_id. One of those products will have a matching entry in the products_description table, the other will not. (Same with reviews, specials, and any other tables that reference products_id). Is this correct?

Contributions

 

Discount Coupon Codes

Donations

Posted
Okay, if the duplicated products are in the products table, and not the products_description table, then there should be no language_id. It is stored in the products_description table. I just want to be clear on what you're saying.

 

Find a product that is duplicated. From what I understand, you will see a product with all the same information except products_id. One of those products will have a matching entry in the products_description table, the other will not. (Same with reviews, specials, and any other tables that reference products_id). Is this correct?

Yes you are right

Archived

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

×
×
  • Create New...