hi Houdini
MySQL allows you to store some wrong date values into DATE and DATETIME
columns (like '2000-02-31' or '2000-02-00'). The idea is that it’s not the job
of the SQL server to validate dates. If MySQL can store a date value and retrieve
exactly the same value, MySQL stores it as given. If the date is totally wrong
(outside the server’s ability to store it), the special date value '0000-00-00' is
stored in the column instead.
If you set an ENUM column to an unsupported value, it is set to the error value
empty string, with numeric value 0.
I want exactly like this if the user has entered wrong date the field should the special date value '0000-00-00' is stored in the column instead . and it should prompt the user to enter the correct date.
and what is ¡ If you set an ENUM column to an unsupported value, it is set to the error value
empty string, with numeric value 0.
The MySQL server performs only basic checking on the validity of a date: The ranges
for year, month, and day are 1000 to 9999, 00 to 12, and 00 to 31. Any date containing
parts not within these ranges is subject to conversion to '0000-00-00'. Please note
that this still allows you to store invalid dates such as '2002-04-31'. To ensure a date
is valid, perform a check in your application.