Possible Duplicate:
MySQL ignores the NOT NULL constraint
I set a column to be not null but when inserting new row and put this field value with null mysql inserts the row how i prevent that?
Possible Duplicate:
MySQL ignores the NOT NULL constraint
I set a column to be not null but when inserting new row and put this field value with null mysql inserts the row how i prevent that?
did you insert the value on database field like
insert into table
values('');
or
insert into table
values(null);
well both will insert a row in database but the field will be with null value. NULL is a keyword which indicates a field value that is null. if you want the field value will be empty then thats not null actually. to do so you have to do
insert into table values(' '); // a space bar in between ' ' so thats not null