PDA

View Full Version : MySQL Question Regarding 'Null' Fields:


So_1337
10-09-2008, 12:03 PM
When doing INSERT queries, how would I go about adding a "null" field. Just using '' doesn't seem to do it, it just leaves the field blank. I want it actually marked as null.

Thanks for any help =)

Derision
10-09-2008, 01:07 PM
insert into test1 values('abc',NULL);

?

So_1337
10-09-2008, 01:12 PM
Well no kidding, it really was that easy =) Thank you!

Bulle
10-09-2008, 01:13 PM
You can try :
insert into rule_values values (12,'X',null);