Magento error. I need someone explaining me exactely how to fix it.
After inserting of products with csv file I noticed that the products were already inside the Magento database and now every time I try to insert a new product here is what comes out:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '16390-1' for key 'UNQ_CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID_STOCK_ID'
the problem is easy to solve according to what I read on the web is a string to be corrected:
$product->save();
to
$product->getResource()->save($product);