php-doc-en/reference/cubrid/functions/cubrid-field-seek.xml
Jakub Vrana 35d7bcbee5 Fix protos
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@308222 c90b9560-bf6c-de11-be94-00142212c4b1
2011-02-10 20:22:25 +00:00

127 lines
3.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.cubrid-field-seek" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>cubrid_field_seek</refname>
<refpurpose>Moves the result set cursor to the specified field offset</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>cubrid_field_seek</methodname>
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>field_offset</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
This function moves the result set cursor to the specified field offset. This offset is used by <function>cubrid_fetch_field</function> if it doesn't include a field offset. It returns TRUE on success or FALSE on failure.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>result</parameter></term>
<listitem><para><parameter>result</parameter> comes from a call to <function>cubrid_execute</function></para></listitem>
</varlistentry>
<varlistentry>
<term><parameter>field_offset</parameter></term>
<listitem><para>The numerical field offset. The <parameter>field_offset</parameter> starts at 0. If <parameter>field_offset</parameter> does not exist, an error of level <constant>E_WARNING</constant> is also issued.</para></listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&true; on success.
</para>
<para>
&false; on failure.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>cubrid_field_seek</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$link = cubrid_connect("localhost", 30000, "demodb2", "dba", "");
if (!$link)
{
die('Could not connect.');
}
$query = 'SELECT id, name, address, salary FROM employees';
$result = cubrid_execute($link, $query);
if ($result)
{
cubrid_field_seek($result,2);
$meta = cubrid_fetch_field($result);
if (!$meta)
{
echo "No information available<br />\n";
}
echo "<pre>
max_length: $meta->max_length
multiple_key: $meta->multiple_key
name: $meta->name
not_null: $meta->not_null
numeric: $meta->numeric
table: $meta->table
type: $meta->type
default: $meta->def
unique_key: $meta->unique_key
</pre>";
cubrid_close_request($result);
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
Result:
max_length: 21
multiple_key: 1
name: address
not_null: 0
numeric: 0
table: employees
type: STRING
default:
unique_key: 0
]]>
</screen>
</example>
</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:"~/.phpdoc/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
-->