fbsql_list_fields
(PHP 4 >= 4.0.6, PHP 5)
fbsql_list_fields — List FrontBase result fields
Descrição
$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
Valor Retornado
Returns a result pointer which can be used with the
fbsql_field_xxx functions, or FALSE on error.
Erros
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
Example #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 à:
field1 field2 field3 ...
Veja Também
- fbsql_field_len() - Returns the length of the specified field
- fbsql_field_name() - Get the name of the specified field in a result
- fbsql_field_type() - Get the type of the specified field in a result
- fbsql_field_flags() - Get the flags associated with the specified field in a result