Home  >  Article  >  Backend Development  >  Tips to get all possible values ​​of ENUM enumeration column in MYSQL. _PHP Tutorial

Tips to get all possible values ​​of ENUM enumeration column in MYSQL. _PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:29:30938browse

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
"; } ?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/531700.htmlTechArticleGetting all possible values ​​of the ENUM (enumeration) column in MYSQL does not actually require any other functions to support this , just use some SQL statements provided by MYSQL. Here for simplicity...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn