mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-20 19:08:54 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@83668 c90b9560-bf6c-de11-be94-00142212c4b1
85 lines
2.4 KiB
XML
85 lines
2.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.3 $ -->
|
|
<!-- splitted from ./en/functions/fbsql.xml, last change in rev 1.1 -->
|
|
<refentry id="function.fbsql-data-seek">
|
|
<refnamediv>
|
|
<refname>fbsql_data_seek</refname>
|
|
<refpurpose>Move internal result pointer</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>fbsql_data_seek</methodname>
|
|
<methodparam><type>resource</type><parameter>result_identifier</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>row_number</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
<para>
|
|
<function>fbsql_data_seek</function> moves the internal row
|
|
pointer of the FrontBase result associated with the specified
|
|
result identifier to point to the specified row number. The next
|
|
call to <function>fbsql_fetch_row</function> would return that
|
|
row.
|
|
</para>
|
|
<para>
|
|
<parameter>Row_number</parameter> starts at 0.
|
|
</para>
|
|
<example>
|
|
<title><function>fbsql_data_seek</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$link = fbsql_pconnect ("localhost", "_SYSTEM", "secret")
|
|
or die ("Could not connect");
|
|
|
|
fbsql_select_db ("samp_db")
|
|
or die ("Could not select database");
|
|
|
|
$query = "SELECT last_name, first_name FROM friends;";
|
|
$result = fbsql_query ($query)
|
|
or die ("Query failed");
|
|
|
|
# fetch rows in reverse order
|
|
|
|
for ($i = fbsql_num_rows ($result) - 1; $i >=0; $i--) {
|
|
if (!fbsql_data_seek ($result, $i)) {
|
|
printf ("Cannot seek to row %d\n", $i);
|
|
continue;
|
|
}
|
|
|
|
if(!($row = fbsql_fetch_object ($result)))
|
|
continue;
|
|
|
|
printf("%s %s<BR>\n", $row->last_name, $row->first_name);
|
|
}
|
|
|
|
fbsql_free_result ($result);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</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:"../../../../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
|
|
-->
|