Jump to content

[RESOLVED] Repair Database Table?


Recommended Posts

After my issues with missing images 


I had to restore the CubeCart_filemanager table in the database by merging two backup files. However, this has created duplicate entries with the result that there is no primary key etc. Images can no longer be allocated to products in admin.

I have located the duplicates using the query:

SELECT filename, COUNT(filename) FROM CubeCart_filemanager GROUP BY filename HAVING COUNT(filename) > 1;

But some images are used twice; once by a product and once by a category - as seen when I search for a particular image filename which is duplicated (see db-image1.jpg below)


They also have identical md5hash entries.

The phpmyadmin screenshot taken from a healthy CubeCart_filemanager table should have the structure seen in db-image2.jpg below:


Any idea how can I remove the unnecessary duplicates and restore the integrity of the CubeCart_filemanager table????

Link to comment
Share on other sites

On 12/6/2019 at 7:15 PM, bsmither said:

Having duplicate primary values seems to suggest that two backups of that one table was used, when only the latest should have been used.

Yes, that's it. My stupid error. I was concerned at losing the latest product details which had been added since and tried to be clever but failed miserably.

Thanks again for your expert advice bsmither!

Link to comment
Share on other sites


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

  • Create New...