Warning: #1265 Data truncated for column 'pdd' at row 1
mysql
Solution
As the message error says, you need to Increase the length of your column to fit the length of the data you are trying to insert (`0000-00-00)`
EDIT 1:
Following your comment, I run a test table:
mysql> create table testDate(id int(2) not null auto_increment, pdd date default null, primary key(id));
Query OK, 0 rows affected (0.20 sec)
Insertion:
mysql> insert into testDate values(1,'0000-00-00');
Query OK, 1 row affected (0.06 sec)
EDIT 2:
So, aparently you want to insert a NULL value to `pdd` field as your comment states ? You can do that in 2 ways like this:
Method 1:
mysql> insert into testDate values(2,'');
Query OK, 1 row affected, 1 warning (0.06 sec)
Method 2:
mysql> insert into testDate values(3,NULL);
Query OK, 1 row affected (0.07 sec)
EDIT 3:
You failed to change the default value of `pdd` field. Here is the syntax how to do it (in my case, I set it to NULL in the start, now I will change it to NOT NULL)
mysql> alter table testDate modify pdd date not null;
Query OK, 3 rows affected, 1 warning (0.60 sec)
Records: 3 Duplicates: 0 Warnings: 1
Problem
I am having trouble trying to set the `PDD`(patient death date) to null on PHPMYADMIN until such death date comes; also on the client end then I can check for `NULL` data to use it. Could anyone suggest me a solution, please ? ``` patientnhs_no hospital_no sex name surname dob address pls pdd 1001001001 6000001 m john smith 1941-01-01 Bournmouth 1 0000-00-00 ``` (PDD should be null if is alive or death date if died)