Skip to content
Advertisement

MYSQL toggle enum values on each call

I want this to be like this.

I have an ENUM column with 0 AND 1, i want to toggle between these two values on each query.

I tried this, but it leaves the column empty.

Thanks.

Advertisement

Answer

I don’t like enum for various reasons. Especially when you use it to store 0 and 1 it can be confusing, yes, even error prone.

Use a tinyint, it’s much easier to use and more readable.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement