I have a few columns in my table where I've specified NOT NULL.
My INSERT statement:
INSERT INTO table SET resourceID='234234', billingDescription='Test desc';
Note I did not set a value for taskID which was specified as NOT NULL
My application was originally built on Window XP, Apache 2, PHP 5, MySQL 5. This statement was not accepted.
When I moved it to Fedora Core 4, Apache 2, PHP 5, MySQL 4.1 the INSERT statement is accepted. This is not good.
On the windows machine in the command prompt
+--------------------+-------------------------------------------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+-------------------------------------------------+------+-----+---------------------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| resourceID | varchar(36) | NO | | | |
| taskID | varchar(36) | NO | | | |
| billingDescription | varchar(1000) | YES | | NULL | |
| portalDescription | varchar(1000) | YES | | NULL | |
However on the fedora machine:
+--------------------+-------------------------------------------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+-------------------------------------------------+------+-----+-------------------+----------------+
| id | int(8) | | PRI | NULL | auto_increment |
| resourceID | varchar(36) | | | | |
| taskID | varchar(36) | | | | |
| billingDescription | text | YES | | NULL | |
I suspect the problem has something to do either with the fact that 'NO' is not indicated in the null column or that the default value is blank for the NOT NULL fields.