php-doc-en/reference/ovrimos/functions/ovrimos-fetch-into.xml
Hartmut Holzgraefe 5b9fc29465 revision tags added
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78496 c90b9560-bf6c-de11-be94-00142212c4b1
2002-04-17 06:45:35 +00:00

91 lines
3.1 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/ovrimos.xml, last change in rev 1.1 -->
<refentry id="function.ovrimos-fetch-into">
<refnamediv>
<refname>ovrimos_fetch_into</refname>
<refpurpose>Fetches a row from the result set</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>ovrimos_fetch_into</methodname>
<methodparam><type>int</type><parameter>result_id</parameter></methodparam>
<methodparam><type>array</type><parameter>result_array</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>how</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>rownumber</parameter></methodparam>
</methodsynopsis>
<para>
<function>ovrimos_fetch_into</function> is used to fetch a row
from the result set.
</para>
<para>
<function>ovrimos_fetch_into</function> fetches a row from the
result set into 'result_array', which should be passed by
reference. Which row is fetched is determined by the two last
parameters. 'how' is one of 'Next' (default), 'Prev', 'First',
'Last', 'Absolute', corresponding to forward direction from
current position, backward direction from current position,
forward direction from the start, backward direction from the end
and absolute position from the start (essentially equivalent to
'first' but needs 'rownumber'). Case is not
significant. 'Rownumber' is optional except for absolute
positioning. Returns &true; or &false;.
</para>
<para>
<example>
<title>A fetch into example</title>
<programlisting role="php">
<![CDATA[
<?php
$conn=ovrimos_connect ("neptune", "8001", "admin", "password");
if ($conn!=0) {
echo "Connection ok!";
$res=ovrimos_exec ($conn,"select table_id, table_name from sys.tables");
if ($res != 0) {
echo "Statement ok!";
if (ovrimos_fetch_into ($res, &$row)) {
list ($table_id, $table_name) = $row;
echo "table_id=".$table_id.", table_name=".$table_name."\n";
if (ovrimos_fetch_into ($res, &$row)) {
list ($table_id, $table_name) = $row;
echo "table_id=".$table_id.", table_name=".$table_name."\n";
} else {
echo "Next: error\n";
}
} else {
echo "First: error\n";
}
ovrimos_free_result ($res);
}
ovrimos_close($conn);
}
?>
]]>
</programlisting>
</example>
This example will fetch a row.
</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
-->