Home > Article > Backend Development > Tips to get all possible values of ENUM enumeration column in MYSQL. _PHP Tutorial
Obtaining all possible values of the ENUM (enumeration) column in MYSQL actually does not require any other functions to support this. You only need to use some SQL statements provided by MYSQL. For the sake of simplicity, here we take the MYSQL system table USER as an example to retrieve all possible values of the SELECT_PRIV column. Method: SHOW COLUMNS FROM table_name LIKE enum_column_name The lowercase part needs to be changed according to your situation. Program: "; $enum_arr=explode("(",$enum); $enum=$enum_arr[1]; $enum_arr=explode(")",$enum); $enum=$enum_arr[0] ; $enum_arr=explode(",",$enum); for($i=0;$i
"; } ?>