Jump to content

[SOLVED] Null value in Float/INT type field


abdfahim

Recommended Posts

Well, it could be that you assigned a default value to that column.

That means, by default it will be "The value" irrespective of whether it is aligned to be a null value.

 

Try removing the default value of that column, and then try again inserting a null/empty value.

well, in DEFAULT field .. if I keep blank, it automatically show NULL in DEFAULT field. And it insert zero (O) in that field. I attach my sql queries here ..

 

If I put

INSERT INTO abc (`column1`,`column2`) VALUES ('aa','')

It inser Zero in the field column2,

 

If I put

INSERT INTO abc (`column1`) VALUES ('aa')

It inser "NULL" in the field column2.

When I want to add a null/Empty value in a INT/Float type field, it insert a Zero (0) there, Irrespective of setting NULL or NOT NULL. How can I insert a null in a float type field?

You have to make sure the column was defined properly.

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.