<HTML ><HEAD ><TITLE >sesam_field_array</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="SESAM database functions" HREF="ref.sesam.html"><LINK REL="PREVIOUS" TITLE="sesam_fetch_row" HREF="function.sesam-fetch-row.html"><LINK REL="NEXT" TITLE="sesam_field_name" HREF="function.sesam-field-name.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.sesam-fetch-row.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.sesam-field-name.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.sesam-field-array" ></A >sesam_field_array</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN83489" ></A ><P > (PHP 3 CVS only)</P >sesam_field_array -- Return meta information about individual columns in a result </DIV ><DIV CLASS="refsect1" ><A NAME="AEN83492" ></A ><H2 >Description</H2 >array <B CLASS="methodname" >sesam_field_array</B > ( string result_id)<BR ></BR ><P > <TT CLASS="parameter" ><I >result_id</I ></TT > is a valid result id returned by <A HREF="function.sesam-query.html" ><B CLASS="function" >sesam_query()</B ></A >. </P ><P > Returns a mixed associative/indexed array with meta information (column name, type, precision, ...) about individual columns of the result after the query associated with <TT CLASS="parameter" ><I >result_id</I ></TT >. </P ><P > <DIV CLASS="table" ><A NAME="AEN83506" ></A ><P ><B >Table 1. Mixed result set returned by <B CLASS="function" >sesam_field_array()</B > </B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><THEAD ><TR ><TH ALIGN="LEFT" VALIGN="MIDDLE" >Array Element</TH ><TH ALIGN="LEFT" VALIGN="MIDDLE" >Contents</TH ></TR ></THEAD ><TBODY ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >int $arr["count"]</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" > Total number of columns in result set (or zero if this was an "immediate" query). SESAM "multiple fields" are "inlined" and treated like the respective number of columns. </TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >string $arr[col]["name"]</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" > column name for column(<TT CLASS="literal" >col</TT >), where <TT CLASS="literal" >col</TT > is between 0 and <TT CLASS="literal" >$arr["count"]-1</TT >. The returned value can be the empty string (for dynamically computed columns). SESAM "multiple fields" are "inlined" and treated like the respective number of columns, each with the same column name. </TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >string $arr[col]["count"]</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" > The "count" attribute describes the repetition factor when the column has been declared as a "multiple field". Usually, the "count" attribute is 1. The first column of a "multiple field" column however contains the number of repetitions (the second and following column of the "multiple field" contain a "count" attribute of 1). This can be used to detect "multiple fields" in the result set. See the example shown in the <A HREF="function.sesam-query.html" ><B CLASS="function" >sesam_query()</B ></A > description for a sample use of the "count" attribute. </TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >string $arr[col]["type"]</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" > php variable type of the data for column(<TT CLASS="literal" >col</TT >), where <TT CLASS="literal" >col</TT > is between 0 and <TT CLASS="literal" >$arr["count"]-1</TT >. The returned value can be one of <P ></P ><UL ><LI ><P ><A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A ></P ></LI ><LI ><P ><A HREF="language.types.float.html" ><B CLASS="type" >float</B ></A ></P ></LI ><LI ><P ><A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></P ></LI ></UL > depending on the SQL type of the result. SESAM "multiple fields" are "inlined" and treated like the respective number of columns, each with the same php type. </TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >string $arr[col]["sqltype"]</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" > SQL variable type of the column data for column(<TT CLASS="literal" >col</TT >), where <TT CLASS="literal" >col</TT > is between 0 and <TT CLASS="literal" >$arr["count"]-1</TT >. The returned value can be one of <P ></P ><UL ><LI ><P >"CHARACTER"</P ></LI ><LI ><P >"VARCHAR"</P ></LI ><LI ><P >"NUMERIC"</P ></LI ><LI ><P >"DECIMAL"</P ></LI ><LI ><P >"INTEGER"</P ></LI ><LI ><P >"SMALLINT"</P ></LI ><LI ><P >"FLOAT"</P ></LI ><LI ><P >"REAL"</P ></LI ><LI ><P >"DOUBLE"</P ></LI ><LI ><P >"DATE"</P ></LI ><LI ><P >"TIME"</P ></LI ><LI ><P >"TIMESTAMP"</P ></LI ></UL > describing the SQL type of the result. SESAM "multiple fields" are "inlined" and treated like the respective number of columns, each with the same SQL type. </TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >string $arr[col]["length"]</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" > The SQL "length" attribute of the SQL variable in column(<TT CLASS="literal" >col</TT >), where <TT CLASS="literal" >col</TT > is between 0 and <TT CLASS="literal" >$arr["count"]-1</TT >. The "length" attribute is used with "CHARACTER" and "VARCHAR" SQL types to specify the (maximum) length of the string variable. SESAM "multiple fields" are "inlined" and treated like the respective number of columns, each with the same length attribute. </TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >string $arr[col]["precision"]</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" > The "precision" attribute of the SQL variable in column(<TT CLASS="literal" >col</TT >), where <TT CLASS="literal" >col</TT > is between 0 and <TT CLASS="literal" >$arr["count"]-1</TT >. The "precision" attribute is used with numeric and time data types. SESAM "multiple fields" are "inlined" and treated like the respective number of columns, each with the same precision attribute. </TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >string $arr[col]["scale"]</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" > The "scale" attribute of the SQL variable in column(<TT CLASS="literal" >col</TT >), where <TT CLASS="literal" >col</TT > is between 0 and <TT CLASS="literal" >$arr["count"]-1</TT >. The "scale" attribute is used with numeric data types. SESAM "multiple fields" are "inlined" and treated like the respective number of columns, each with the same scale attribute. </TD ></TR ></TBODY ></TABLE ></DIV > </P ><P > See the <A HREF="function.sesam-query.html" ><B CLASS="function" >sesam_query()</B ></A > function for an example of the <B CLASS="function" >sesam_field_array()</B > use. </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.sesam-fetch-row.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.sesam-field-name.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >sesam_fetch_row</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.sesam.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >sesam_field_name</TD ></TR ></TABLE ></DIV ></BODY ></HTML >