CREATE TABLE information (
id int(11) NOT NULL,
info text NULL
);
That's an overly basic table structure, but should give you the idea. The above tells the field id that it can never be null, and therefore mysql assigns the default to 0. In your example, you told the field to never be null, so if you want to allow null, you have to tell the field that it can be null. I hope that made sense. :/
----------------------------
"Security is like an onion" - Unknown
I thought the whole point of "not null" is to prevent records from being inserted w/o missing key information. The default is to allow nulls to be inserted into the record. I'm looking for the opposite effect.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.