ENUM in MySQL.
I have a field in a table that decides in a particular record is to be included in results for a particular area.
Basically, the table is holding details of venues that people can visit. I'm developing two sites, one for tourists and one for businesses looking for conference venues.
Since most details are identical, it made sense to have all venues in one table. All venues will be included on the business site, but only a portion on the tourism site. I have added a field that initially was going to contain 0 or 1, 1 denoting that the record in question is a valid "touristy" record.
Then I remembered enum, which I have never used before. Would that be more appropriate in this instance, and if so, why?
If anyone is a datatype guru, I'd really appreciate a little guidance here!
Actually 1 or 0 is good if your column name is enabled or disabled. Which means you will not add anymore values to it.
Only drawback is that if you want that colum hold more than one meaning.
Something like enabled, disabled, waitingforconfirmation, deleted(this means deleted virtually but waiting for confirmation for final deletion)
if you dont expect column contain more than 2 values then keep your 1/0. IMHO
Excellent, that works for me!