RE: [PHP] mysql_field_type() ...

From: Date: Mon, 03 Nov 2003 20:15:44 +0000
Subject: RE: [PHP] mysql_field_type() ...
Groups: php.general 
Request: Send a blank email to php-general+get-168412@lists.php.net to get a copy of this message
[snip] ...will say if a field is of type "ENUM", but not its possible values (including default). Does anyone know how I can fetch possible values of a field type of ENUM? [/snip] You would have to use DESCRIBE. So if DESCRIBE db; //in the mysql table returns -- +-----------------+-----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------------+-----------------+------+-----+---------+-------+ | Host | char(60) binary | | PRI | | | | Db | char(64) binary | | PRI | | | | User | char(16) binary | | PRI | | | | Select_priv | enum('N','Y') | | | N | | | Insert_priv | enum('N','Y') | | | N | | | Update_priv | enum('N','Y') | | | N | | | Delete_priv | enum('N','Y') | | | N | | | Create_priv | enum('N','Y') | | | N | | | Drop_priv | enum('N','Y') | | | N | | | Grant_priv | enum('N','Y') | | | N | | | References_priv | enum('N','Y') | | | N | | | Index_priv | enum('N','Y') | | | N | | | Alter_priv | enum('N','Y') | | | N | | +-----------------+-----------------+------+-----+---------+-------+ you can get the info from the Type column

« previous php.general (#168412) next »