Thread mysql: ENUM und default (11 answers)
Opened by Froschpopo at 2007-04-25 13:48

nepos
 2007-04-25 17:16
#35420 #35420
User since
2005-08-17
1420 Artikel
BenutzerIn
[Homepage] [default_avatar]
Ehm, '' ist aber soweit ok. Es ist kein NULL-Wert und MySQL setzt, wenn man keinen gültigen Wert aus dem Bereich des ENUM-Typs angibt automatisch einen leeren String ein:
Quote
If you insert an invalid value into an ENUM (that is, a string not present in the list of allowed values), the empty string is inserted instead as a special error value. This string can be distinguished from a &“normal&” empty string by the fact that this string has the numerical value 0. More about this later.


Eventuell solltest du den strict SQL mode aktivieren, dann würdest du einen Fehler bekommen, wenn du einen Wert eintragen willst, der nicht im ENUM dabei ist.

View full thread mysql: ENUM und default