You are here:  » drop remaining records of merchant

Support Forum



drop remaining records of merchant

Submitted by raveon on Tue, 2011-10-18 07:18 in

David when I deregistered (deleted) a feed for a merchant with many records (109,000) the process timed out leaving 40,000 plus records in the DB that I cannot get rid of.

I tried registering a new version of the feed but I get duplicate entry errors.

How can I easily delete all records from the DB for one merchant. If this times out perhaps a "slow delete" would be needed?

Thanks

Submitted by support on Tue, 2011-10-18 07:50

Hi raveon,

The following script will run the delete process; and print "Done" if runs to completion; otherwise simply repeat the process until it does complete with the "Done" message (as it may also time-out of course). Don't forget to change "Merchant Name" at line 3 with the merchant name you're deleting...

<?php
  
require("includes/common.php");
  
$merchant "Merchant Name";
  
$sql "DELETE FROM `".$config_databaseTablePrefix."products`
            WHERE merchant='"
.database_safe($merchant)."'";
  
database_queryModify($sql,$result);
  print 
"Done.";
?>

Save the above code as something like delmerchant.php and then upload and browse to from the main Price Tapestry installation folder. I'll look into a slow delete for you that should be straight forward using a similar method to the slow import.

Cheers,
David.
--
PriceTapestry.com

Submitted by raveon on Tue, 2011-10-18 08:34

thanks david.... the script does remove all records... I checked using PHPmyadmin

However

I still get duplicate record errors!! tried everything I can think of.

][Duplicate entry 'e07e418f9b228a88f4a18955ef3748b1' for key 'dupe_filter']
Warning: Cannot modify header information - headers already sent by (output started at /home/XXXXXX/public_html/includes/database.php:55) in /home/XXXXXX/public_html/admin/feeds_import.php on line 31

Submitted by support on Tue, 2011-10-18 09:03

Hi raveon,

Double check that they're not "normal" duplicate product warnings from within the feed itself - what I'd suggest is studying the SQL being output by database debug mode where you will see the product name within the text. After import, locate the product on your site; and then run the delete script once more. Next, double check that the product no longer appears and that will confirm that it is a within-feed duplication rather than a database inconsistency. If that looks like the case; check this thread for discussion about handling duplication using filters to combine additional fields to add greater product name variety...

Cheers,
David.
--
PriceTapestry.com