Marius05 Posted September 22, 2016 Share Posted September 22, 2016 Hi! How ken update column in table with NULL value? Db::getInstance()->update('product_attribute_shop', array('default_on' => NULL,), '`id_product` = '.(int)$x.' AND `id_product_attribute` = '.(int)$y); set 0 value. Thank you Link to comment Share on other sites More sharing options...
modprestashop Posted September 22, 2016 Share Posted September 22, 2016 With update() function you can't achieve that. Do this instead. Db::getInstance()->execute('UPDATE `ps_product_attribute_shop` SET `default_on` = NULL WHERE `id_product` = '.(int)$x.' AND `id_product_attribute` = '.(int)$y); You need to do this because update function wrap your NULL with single quote and it becomes string then. 1 Link to comment Share on other sites More sharing options...
Marius05 Posted September 23, 2016 Author Share Posted September 23, 2016 Thank you! Problem solved. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now