0

My table on my mysql-server contains a column that acts as a keyword for a filter mechanism on the website I am working on. The entries will be filled by some other people and I dont want to have entries with possible typos in there, because that would mess up the filter. So I want to make it foolproof and restrict the possible inputs into that column to a defined set.

I kind of remember that this could be easily defined somewhere, but I dont know how anymore. Could someone give me a hint?

Big thanks! Yannic

Yannic Welle
  • 207
  • 2
  • 10
  • Thanks for looking! Found a solution myself: http://stackoverflow.com/questions/6367063/how-to-restrict-a-column-value-in-sqlite-mysql – Yannic Welle Jul 26 '14 at 12:25
  • Thanks Michael, that was what I was looking for. I found it in the meantime though ^^ – Yannic Welle Jul 26 '14 at 12:27
  • 1
    Note that if `sql_mode` is not set to STRICT, MySQL won't actually error on values inserted which aren't in the ENUM list. Enabling strict mode will cause it to outright reject bad values with an error. http://dev.mysql.com/doc/refman/5.1/en/sql-mode.html – Michael Berkowski Jul 26 '14 at 12:31
  • Thanks for the note, I may need that hint...^^ – Yannic Welle Jul 26 '14 at 12:39

0 Answers0