Mysql: handling null values during a insert

Published by

Posted on October 06, 2008

Example of inserting null values/string is as follows
null columns for testing purpose
test1 and test2

INSERT INTO reguser_active (test1, test2) values (”,”);

” tells mysql to insert a empty string into the column , you may also insert a
null value into the not null column as such

INSERT INTO reguser_active (test1, test2) values (‘null’,’null’);

and lastly you can modified your columns to allow null values.

Reference sites
http://dev.mysql.com/doc/refman/5.0/en/problems-with-null.html

http://dev.mysql.com/doc/refman/5.0/en/insert.html