I am trying to set a record back to null. I was able to change it from null and now I want to change it back to null. For some reason it is not working.

This worked perfectly fine:

UPDATE  members set end_date = "2017-01-18" where player = 1 and end_date is NULL;
Query OK, 1 row affected (0.07 sec)
Rows matched: 1  Changed: 1  Warnings: 0

This is not working.

UPDATE  members set end_date = NULL where player = 1 and end_date is "2017-01-18";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"2017-01-18"' at line 1

"is" instead of "=".

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.