I've created a table with some NOT NULL columns using phpMyAdmin.
CREATE TABLE `TEST` (`ID` INT PRIMARY KEY AUTO_INCREMENT,
`Firstname` VARCHAR(20) NOT NULL,
`Lastname` VARCHAR(20) NOT NULL)
There is no problem with INSERT operation. Database prevent to set a NULL field properly.
INSERT INTO `TEST`(`Firstname`, `Lastname`) VALUES ("Peter", null)
#1048 - Column 'Lastname' cannot be null
The accepted one is:
INSERT INTO `TEST`(`Firstname`, `Lastname`) VALUES ("Peter", "Smith")
1 row inserted.
Inserted row id: 1 (Query took 0.0004 sec)
But after I've created a record with non-NULL fields successfully, database allows me to UPDATE these fields to NULL.
UPDATE `TEST` SET `Lastname`=NULL WHERE `ID` = 1
1 row affected. (Query took 0.0006 sec)
I've tried "NULL" and 'NULL' as well, but database put them in the field as a string.
I'm really confused about this issue. Is this a phpMyAdmin bug or I'm doing something wrong?