php-doc-en/reference/mssql/functions/mssql-data-seek.xml
Martin Samesch 37fa587c55 WS only
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@291760 c90b9560-bf6c-de11-be94-00142212c4b1
2009-12-06 10:58:36 +00:00

114 lines
2.8 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<refentry xml:id="function.mssql-data-seek" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>mssql_data_seek</refname>
<refpurpose>Moves internal row pointer</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>mssql_data_seek</methodname>
<methodparam><type>resource</type><parameter>result_identifier</parameter></methodparam>
<methodparam><type>int</type><parameter>row_number</parameter></methodparam>
</methodsynopsis>
<para>
<function>mssql_data_seek</function> moves the internal row
pointer of the MS SQL result associated with the specified result
identifier to point to the specified row number, first row being
number 0. The next call to <function>mssql_fetch_row</function>
would return that row.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>result_identifier</parameter></term>
<listitem>
<para>
The result resource that is being evaluated.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>row_number</parameter></term>
<listitem>
<para>
The desired row number of the new result pointer.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>mssql_data_seek</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
// Connect to MSSQL and select the database
$link = mssql_connect('MANGO\SQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php', $link);
// Select all people
$result = mssql_query('SELECT [name], [age] FROM [persons] WHERE [age] >= 13');
if (!$result) {
die('Query failed.');
}
// Select every 4th student in the results
for ($i = mssql_num_rows($result) - 1; $i % 4; $i++) {
if (!mssql_data_seek($result, $i)) {
continue;
}
// Fetch the row ...
}
// Free the query result
mssql_free_result($result);
?>
]]>
</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:"~/.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
-->