issue with NOT NULL in mysql -


enter image description here

i using wamp in win 7.

in database, have 1 table be_users, 2 fields: username , email, both of them set not null.

but why still can insert empty value , null value field: email, see below image: enter image description here

actually, inserting text , not null. text null different null. can never violate rule if field set not null.

try executing statement,

insert tablename values (null, null)  -- fail 

it surely fail because null. statement below surely work because inserting string.

insert tablename values ('', 'null')  -- work 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -