fbsql_list_fields

(PHP 4 >= 4.0.6, PHP 5)

fbsql_list_fields -- List FrontBase result fields

Descrição

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

Retrieves information about the given table.

Parâmetros

database_name

The database name.

table_name

The table name.

link_identifier

Um identificador de conexão FrontBase retornado por fbsql_connect() ou fbsql_pconnect().

Se opcional e não especificado, a função tentará encontrar uma conexão aberta para o servidor FrontBase server e se não for encontrada uma conexão dessa ela irá tentar criar uma como se fbsql_connect() fosse chamada sem argumentos

Valores de retornado

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

Erros/Excessões

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.

Exemplos

Exemplo 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";;
}
?>

O exemplo acima irá imprimir algo similar a:

field1
field2
field3
...

Veja também

fbsql_field_len()
fbsql_field_name()
fbsql_field_type()
fbsql_field_flags()