php-doc-en/reference/oci8/functions/ocinumcols.xml
2003-12-15 16:55:22 +00:00

71 lines
1.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/oci8.xml, last change in rev 1.2 -->
<refentry id="function.ocinumcols">
<refnamediv>
<refname>ocinumcols</refname>
<refpurpose>
Return the number of result columns in a statement
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ocinumcols</methodname>
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
</methodsynopsis>
<para>
<function>ocinumcols</function> returns the number of columns in the
statement <parameter>stmt</parameter>.
</para>
<para>
<example>
<title><function>ocinumcols</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
echo "<pre>\n";
$conn = OCILogon("scott", "tiger");
$stmt = OCIParse($conn, "select * from emp");
OCIExecute($stmt);
while (OCIFetch($stmt)) {
echo "\n";
$ncols = OCINumCols($stmt);
for ($i = 1; $i <= $ncols; $i++) {
$column_name = OCIColumnName($stmt, $i);
$column_value = OCIResult($stmt, $i);
echo $column_name . ': ' . $column_value . "\n";
}
echo "\n";
}
OCIFreeStatement($stmt);
OCILogoff($conn);
echo "</pre>";
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->