Join Up!
96806 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousmysql_list_dbsmysql_list_processesnext
Last updated: Tue, 28 May 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | German | Spanish

mysql_list_fields

(PHP 3, PHP 4 >= 4.0.0)

mysql_list_fields -- List MySQL result fields

Description

resource mysql_list_fields ( string database_name, string table_name [, resource 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().

Esimerkki 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.

User Contributed Notes
mysql_list_fields
add a note about notes
There are no user contributed notes for this page.
previousmysql_list_dbsmysql_list_processesnext
Last updated: Tue, 28 May 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST