Home > Software design >  MySQL rejecting date
MySQL rejecting date

Time:07-16

MySQL 8

My query:

"UPDATE `users` SET `start_date` = '2007-04-09' AND `eligibility` = 1 WHERE `user_id` = 36;

I am getting the following error:

Warning: #1292 Truncated incorrect DOUBLE value: '2007-04-09'

I checked the type for the start_date field and it it set to date.

When I check the row, I find that it has NOT been modified, even though this is a warning.

I am using the PHPMyAdmin interface to interact with the MySQL DB/Server.

Any ideas?

CodePudding user response:

You are setting start_date to:

`2007-04-09' AND `eligibility` = 1

You need a comma instead of AND there if you want to set eligibility too.

That specific message comes because '2007-04-09' AND interprets that string as a boolean, which it is calling a DOUBLE.

  • Related