PHP 忒聊
綴豖
ヶ輛
mysql_list_fields
(PHP 3, PHP 4)
Description
mysql_list_fields() retrieves information about the given table name. Arguments are the database name and the table name. A result pointer is returned which can be used with mysql_field_flags(), mysql_field_len(), mysql_field_name(), and mysql_field_type().
瞰赽 1. mysql_list_fields() example
?php $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); $fields = mysql_list_fields("database1", "table1", $link); $columns = mysql_num_fields($fields); for ($i = 0; $i $columns; $i++) {echo mysql_field_name($fields, $i). "\n";}
The above example would produce the following output:
field1 field2 field3...
For downward compatibility mysql_listfields() can also be used. This is deprecated however.
綴豖
れ萸
ヶ輛
mysql_list_dbs
奻珨撰
mysql_list_processes