2014-10-13

I have a script that allows me to add a sample request button to my product pages, I have a script called getSample.php but when I click on the sample button on the product page I'm taken to getSample.php which is showing this error:

Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or
update a child row: a foreign key constraint fails
(japecilot_mage2.mage_catalog_product_entity, CONSTRAINT
FK_OZSS_CAT_PRD_ENTT_ATTR_SET_ID_OZSS_EAV_ATTR_SET_ATTR_SET_ID
FOREIGN KEY (attribute_set_id) REFERENCES `mage_eav_attribute_set)'
in
/var/www/vhosts/webcontrolcentre.co.uk/httpdocs/perfume/lib/Zend/Db/Statement/Pdo.php:228
Stack trace: #0
/var/www/vhosts/webcontrolcentre.co.uk/httpdocs/perfume/lib/Zend/Db/Statement/Pdo.php(228):
PDOStatement->execute(Array) #1
/var/www/vhosts/webcontrolcentre.co.uk/httpdocs/perfume/lib/Varien/Db/Statement/Pdo/Mysql.php(110):
Zend_Db_Statement_Pdo->_execute(Array) #2
/var/www/vhosts/webcontrolcentre.co.uk/httpdocs/perfume/app/code/core/Zend/Db/Statement.php(291):
Varien_Db_Statement_Pdo_Mysql->_execute(Array) #3
/var/www/vhosts/webcontrolcentre.co.uk/httpdocs/perfume/lib/Zend/Db/Adapter/Abstract.php(479):
Zend_Db_Statement->execute(Array) #4 /var/w in
/var/www/vhosts/webcontrolcentre.co.uk/httpdocs/perfume/lib/Zend/Db/Statement/Pdo.php
on line 234

the code in the getSample.php is:

Any ideas on how to fix this?

Thankyou.

Show more