<HTML ><HEAD ><TITLE >fbsql_list_fields</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="FrontBase Functions" HREF="ref.fbsql.html"><LINK REL="PREVIOUS" TITLE="fbsql_list_dbs" HREF="function.fbsql-list-dbs.html"><LINK REL="NEXT" TITLE="fbsql_list_tables" HREF="function.fbsql-list-tables.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.fbsql-list-dbs.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.fbsql-list-tables.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.fbsql-list-fields" ></A >fbsql_list_fields</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN24211" ></A ><P > (PHP 4 >= 4.0.6)</P >fbsql_list_fields -- List FrontBase result fields</DIV ><DIV CLASS="refsect1" ><A NAME="AEN24214" ></A ><H2 >Description</H2 >resource <B CLASS="methodname" >fbsql_list_fields</B > ( string database_name, string table_name [, resource link_identifier])<BR ></BR ><P > <B CLASS="function" >fbsql_list_fields()</B > 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 <A HREF="function.fbsql-field-flags.html" ><B CLASS="function" >fbsql_field_flags()</B ></A >, <A HREF="function.fbsql-field-len.html" ><B CLASS="function" >fbsql_field_len()</B ></A >, <A HREF="function.fbsql-field-name.html" ><B CLASS="function" >fbsql_field_name()</B ></A >, and <A HREF="function.fbsql-field-type.html" ><B CLASS="function" >fbsql_field_type()</B ></A >. </P ><P > A result identifier is a positive integer. The function returns <TT CLASS="constant" ><B >FALSE</B ></TT > if an error occurs. A string describing the error will be placed in <TT CLASS="literal" >$phperrmsg</TT >, and unless the function was called as <TT CLASS="literal" >@fbsql()</TT > then this error string will also be printed out. </P ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN24239" ></A ><P ><B >Example 1. <B CLASS="function" >fbsql_list_fields()</B > example</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="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";; }</PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ><P > The above example would produce the following output: <DIV CLASS="informalexample" ><A NAME="AEN24244" ></A ><P ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="programlisting" >field1 field2 field3 ...</PRE ></TD ></TR ></TABLE ><P ></P ></DIV > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.fbsql-list-dbs.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.fbsql-list-tables.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >fbsql_list_dbs</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.fbsql.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >fbsql_list_tables</TD ></TR ></TABLE ></DIV ></BODY ></HTML >