Warning: include(../lntop.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/mysql-list-fields.html on line 19

Warning: include() [function.include]: Failed opening '../lntop.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/mysql-list-fields.html on line 19

Warning: include(../levoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/mysql-list-fields.html on line 46

Warning: include() [function.include]: Failed opening '../levoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/mysql-list-fields.html on line 46



Учебник РНР
НазадВперёд

mysql_list_fields

(PHP 3, PHP 4)

mysql_list_fields - список полей MySQL-результата.

Описание

resource mysql_list_fields (string database_name, string table_name [, resource link_identifier])

mysql_list_fields() запрашивает информацию о данной таблице tablename. Аргументами являются имя БД и имя таблицы. Возвращаемый результирующий указатель может использоваться функциями mysql_field_flags(), mysql_field_len(), mysql_field_name() и mysql_field_type().

Пример 1. mysql_list_fields()
<?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";
}

Пример даст на выходе:
field1
field2
field3
...

Для обеспечения обратной совместимости можно также использовать mysql_listfields(), но это не рекомендуется.


Назад Оглавление Вперёд
mysql_list_dbs Вверхmysql_list_processes


Warning: include(../pravoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/mysql-list-fields.html on line 155

Warning: include() [function.include]: Failed opening '../pravoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/mysql-list-fields.html on line 155

Rambler's Top100
© 2009 Тест скорости интернета |  Boont.Ru

Warning: include(../lnbottom.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/mysql-list-fields.html on line 281

Warning: include() [function.include]: Failed opening '../lnbottom.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/mysql-list-fields.html on line 281