abdfahim Posted November 11, 2007 Share Posted November 11, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/76848-solved-null-value-in-floatint-type-field/ Share on other sites More sharing options...
nuxy Posted November 11, 2007 Share Posted November 11, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/76848-solved-null-value-in-floatint-type-field/#findComment-389086 Share on other sites More sharing options...
abdfahim Posted November 12, 2007 Author Share Posted November 12, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/76848-solved-null-value-in-floatint-type-field/#findComment-389671 Share on other sites More sharing options...
fenway Posted November 19, 2007 Share Posted November 19, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/76848-solved-null-value-in-floatint-type-field/#findComment-394437 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.