Jump to content

PHP SQL UPDATE TABEL WITH NULL VALUE


Recommended Posts

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.

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...