★ wanayoo — archive 1999 http://www.php.net/manual/function.mysql-list-fields.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to MySQL
Quick Reference
MySQL
* mysql_affected_rows
* mysql_change_user
* mysql_close
* mysql_connect
* mysql_create_db
* mysql_data_seek
* mysql_db_query
* mysql_drop_db
* mysql_errno
* mysql_error
* mysql_fetch_array
* mysql_fetch_field
* mysql_fetch_lengths
* mysql_fetch_object
* mysql_fetch_row
* mysql_field_name
* mysql_field_seek
* mysql_field_table
* mysql_field_type
* mysql_field_flags
* mysql_field_len
* mysql_free_result
* mysql_insert_id
* mysql_list_fields
* mysql_list_dbs
* mysql_list_tables
* mysql_num_fields
* mysql_num_rows
* mysql_pconnect
* mysql_query
* mysql_result
* mysql_select_db
* mysql_tablename
Manual: mysql_list_fields
View the source code for this pageSearch the site



Previous page
 mysql_insert_id
mysql_list_dbs 
Next page


mysql_list_fields

mysql_list_fields -- List MySQL result fields

Description

int mysql_list_fields(string database_name, string table_name, int [link_identifier] );

mysql_list_fields() retrieves information about the given tablename. 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().

A result identifier is a positive integer. The function returns -1 if a error occurs. A string describing the error will be placed in $phperrmsg, and unless the function was called as @mysql() then this error string will also be printed out.

For downward compatibility mysql_listfields() can also be used.


User Contributed Notes: mysql_list_fields


lulu@ctyd.com.mx
22-Dec-1999 03:44
An example: $db = mysql_connect("localhost","user","passwd"); $column = mysql_list_fields("db_name","table",$db); for($i=0; $i<mysql_num_fields($column); $i ) print mysql_name_field($column,$i )."<br>";


mitayai@dreaming.org
05-Jan-2000 11:21
The example above has two typos. Try: $mysql_link=mysql_connect($dbhost,$dbuser,$dbpass); $mysql_link = mysql_connect($dbhost,$dbuser,$dbpass); $column = mysql_list_fields($dbname,$dbtable,$mysql_link); for($i=0; $i<mysql_num_fields($column); $i++ ) { print mysql_field_name($column,$i )."<br>"; }


 About Notes


Previous page
 mysql_insert_id
mysql_list_dbs 
Next page



Site Statistics


Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.