|
mysql_list_fieldsList MySQL table fields Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:
Description
resource mysql_list_fields
( string
$database_name
, string $table_name
[, resource $link_identifier = NULL
] )Retrieves information about the given table name. This function is deprecated. It is preferable to use mysql_query to issue an SQL SHOW COLUMNS FROM table [LIKE 'name'] statement instead. Parameters
Return Values
A result pointer resource on success, or The returned result can be used with mysql_field_flags, mysql_field_len, mysql_field_name and mysql_field_type. Examples
Example #1 Alternate to deprecated mysql_list_fields
<?phpThe above example will output something similar to:
Array
(
[Field] => id
[Type] => int(7)
[Null] =>
[Key] => PRI
[Default] =>
[Extra] => auto_increment
)
Array
(
[Field] => email
[Type] => varchar(100)
[Null] =>
[Key] =>
[Default] =>
[Extra] =>
)
Notes
See Also
|