1

I have datetime column(test_date) with default value set to current_timestamp

but when Update the table it shows

Error in Updation Query
Incorrect datetime value: '' for column 'test_date' at row 1

I even changed the column type to timestamp but still it throws the same error

Error in Insertion Query insert into tbl_testimonials(test_title,test_image,test_content,test_date,status) values('hi','','this is checking','', 'Y') Incorrect datetime value: '' for column 'test_date' at row 1

My question is different : the question in MySQL CURRENT_TIMESTAMP on create and on update discuss about having to timestamp values in the same table and the error is

ERROR 1293 (HY000): Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

But I have a single column with timestamp value and my error is

Incorrect datetime value: '' for column 'test_date' at row 1

So I think my question is different

Please help

Community
  • 1
  • 1
scriptkiddie
  • 585
  • 2
  • 8
  • 24

1 Answers1

2

If you want mysql to do it for you then don't include test_date in your key values. So it should go something like below:

tbl_testimonials  
(test_title,test_image,test_content,status) values  
('hi','','this is checking', 'Y')
Milan Gupta
  • 1,181
  • 8
  • 21