diff --git a/reference/mysql/functions/mysql-list-fields.xml b/reference/mysql/functions/mysql-list-fields.xml index 89d453b99c..cff230e684 100644 --- a/reference/mysql/functions/mysql-list-fields.xml +++ b/reference/mysql/functions/mysql-list-fields.xml @@ -1,5 +1,5 @@ - + @@ -16,6 +16,13 @@ link_identifier + + + The function mysql_list_fields is deprecated. It + is preferable to use mysql_query to issue a + SQL SHOW COLUMNS FROM table [LIKE 'name'] Statement instead. + + mysql_list_fields retrieves information about the given table name. Arguments are the database and @@ -27,30 +34,46 @@ - <function>mysql_list_fields</function> example + Alternate to deprecated <function>mysql_list_fields</function> 0) { + while ($row = mysql_fetch_assoc($result)) { + print_r($row); + } } ?> ]]> - The above example would produce the following output: + The above example would produce output similar to: id + [Type] => int(7) + [Null] => + [Key] => PRI + [Default] => + [Extra] => auto_increment +) +Array +( + [Field] => email + [Type] => varchar(100) + [Null] => + [Key] => + [Default] => + [Extra] => +) ]]> @@ -59,13 +82,11 @@ field3 For downward compatibility mysql_listfields can also be used. This is deprecated however. - - - The function mysql_list_fields is deprecated. It - is preferable to use mysql_query to issue a - SQL SHOW COLUMNS FROM table [LIKE 'name'] Statement instead. - - + + See also + mysql_field_flags and + mysql_info. +