in phpmyadmin
, create table there not null constraints default fields...and per knowledge when set constraint not null...it doesn't allow user remain field empty not null per link.....
http://www.techopedia.com/definition/27370/not-null-constraint
now question is..according link, not null means every row of data must contain value - cannot left blank during insert or update operations.....but when insert data programatically insert into
, able insert data in 2 fields , other remains blank although there not null constraints on fields ...and still not generates error....so don't understand how not null works???
for example, create table lets 5 fields...
create table mytable ( column1 int not null, column2 int not null, column3 int not null, column4 int not null, column5 int not null, )
and insert values in 2 fields
"insert mytable (column1,column2) values(10,20)";
but other fields don't give ''
takes 0
value....and still able insert data no error...how possible??
everything has not null constraint set needs contain data. if insert data programmatically , not insert data not null cell, sql error.
e.g. have table:
create table test ( id integer primary_key auto_increment, some_value integer not null, some_other_value integer);
then some_value contain data in every data set returned, some_other_value may or may not contain data in every data set returned. thing work around this:
create table test ( id integer primary_key auto_increment, some_value integer not null default 0, some_other_value integer);
if set data programatically , not set data some_value, some_value default 0 (or whatever data set default on table creation).