Forum und email
fbsql_list_fields

fbsql_list_fields

(PHP 4 >= 4.0.6, PHP 5)

fbsql_list_fields -- List FrontBase result fields

Opis

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

Retrieves information about the given table.

Parametry

database_name

The database name.

table_name

The table name.

link_identifier

Identyfikator połączenia FrontBase zwrócony przez fbsql_connect() lub fbsql_pconnect().

Jeśli link jest opcjonalny i nie zostanie podany, funkcja spróbuje znaleźć otwarte połączenie do serwera FrontBase i jeśli takiego połączenia nie znajdzie, spróbuje utworzyć je tak jak fbsql_connect() byłaby wywołana bez argumentów

Zwracane wartości

Returns a result pointer which can be used with the fbsql_field_xxx functions, or FALSE on error.

Błędy/Wyjątki

A string describing the error will be placed in $phperrmsg, and unless the function was called as @fbsql() then this error string will also be printed out.

Przykłady

Przykład 1. fbsql_list_fields() example

<?php
$link
= fbsql_connect('localhost', 'myname', 'secret');

$fields = fbsql_list_fields("database1", "table1", $link);
$columns = fbsql_num_fields($fields);

for (
$i = 0; $i < $columns; $i++) {
    echo
fbsql_field_name($fields, $i) . "\n";;
}
?>

Powyższy przykład wyświetli coś podobnego do:

field1
field2
field3
...