How to set enum values in phpmyadmin..I want to set values '0' or '1' in phpmyadmin for my field using an 'enum' type ..
Type "an_enum" in the "Field" edit box. Select "ENUM" from the "Type" drop-down list. Type "'red', 'yellow', 'green'" in the "Length/Values" field. Select "As defined:" from the "Default" drop-down list.
For ENUM , the value is inserted as the error member ( 0 ). For SET , the value is inserted as given except that any invalid substrings are deleted. For example, 'a,x,b,y' results in a value of 'a,b' .
You can add a new value to a column of data type enum using ALTER MODIFY command. If you want the existing value of enum, then you need to manually write the existing enum value at the time of adding a new value to column of data type enum.
The ENUM data type in MySQL is a string object. It allows us to limit the value chosen from a list of permitted values in the column specification at the time of table creation. It is short for enumeration, which means that each column may have one of the specified possible values.
ALTER TABLE `table_name` CHANGE `old_column_name` `new_column_name` ENUM('0','1') DEFAULT NULL
or under your phpmyadmin
choose enum
in Length/Values
column put there : '0' ,'1'
and your done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With