2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 07:54:14 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.maxdb-field-seek">
|
2007-01-29 16:56:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>maxdb_field_seek</refname>
|
2010-05-09 01:54:47 +00:00
|
|
|
<refname>maxdb_result::field_seek</refname>
|
2007-01-29 16:56:02 +00:00
|
|
|
<refpurpose>Set result pointer to a specified field offset</refpurpose>
|
|
|
|
</refnamediv>
|
2007-06-16 19:11:13 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2010-05-09 03:09:46 +00:00
|
|
|
<para>&style.procedural;</para>
|
2007-01-29 16:56:02 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>maxdb_field_seek</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
|
|
|
<methodparam><type>int</type><parameter>fieldnr</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2010-05-09 01:54:47 +00:00
|
|
|
<para>&style.oop;</para>
|
2010-05-09 02:32:24 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>maxdb_result::field_seek</methodname>
|
|
|
|
<methodparam><type>int</type><parameter>fieldnr</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2007-01-29 16:56:02 +00:00
|
|
|
<para>
|
|
|
|
Sets the field cursor to the given offset. The next call to <function>maxdb_fetch_field</function>
|
|
|
|
will retrieve the field definition of the column associated with that offset.
|
|
|
|
</para>
|
|
|
|
<note>
|
|
|
|
<para>To seek to the beginning of a row, pass an offset value of zero.</para>
|
|
|
|
</note>
|
|
|
|
</refsect1>
|
2007-06-16 19:11:13 +00:00
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
2007-01-29 16:56:02 +00:00
|
|
|
<para>
|
|
|
|
<function>maxdb_field_seek</function> returns previuos value of field cursor.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-06-16 19:11:13 +00:00
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2007-01-29 16:56:02 +00:00
|
|
|
<example>
|
2012-01-11 06:50:17 +00:00
|
|
|
<title>&style.oop;</title>
|
2007-01-29 16:56:02 +00:00
|
|
|
<programlisting role="php">
|
2005-03-08 16:39:06 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB");
|
|
|
|
|
|
|
|
/* check connection */
|
|
|
|
if (maxdb_connect_errno()) {
|
|
|
|
printf("Connect failed: %s\n", maxdb_connect_error());
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
$query = "SELECT name, cno from hotel.customer ORDER BY cno";
|
|
|
|
|
|
|
|
if ($result = $maxdb->query($query)) {
|
|
|
|
|
|
|
|
/* Get field information for 2nd column */
|
|
|
|
$result->field_seek(1);
|
|
|
|
$finfo = $result->fetch_field();
|
2007-01-29 16:56:02 +00:00
|
|
|
|
2005-03-08 16:39:06 +00:00
|
|
|
printf("Name: %s\n", $finfo->name);
|
|
|
|
printf("Table: %s\n", $finfo->table);
|
|
|
|
printf("max. Len: %d\n", $finfo->max_length);
|
|
|
|
printf("Flags: %d\n", $finfo->flags);
|
|
|
|
printf("Type: %d\n\n", $finfo->type);
|
2007-01-29 16:56:02 +00:00
|
|
|
|
2005-03-08 16:39:06 +00:00
|
|
|
$result->close();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* close connection */
|
|
|
|
$maxdb->close();
|
|
|
|
?>
|
|
|
|
]]>
|
2007-01-29 16:56:02 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
<example>
|
2012-01-11 06:50:17 +00:00
|
|
|
<title>&style.procedural;</title>
|
2007-01-29 16:56:02 +00:00
|
|
|
<programlisting role="php">
|
2005-01-12 18:53:25 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2005-03-08 16:39:06 +00:00
|
|
|
$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB");
|
2005-01-12 18:53:25 +00:00
|
|
|
|
|
|
|
/* check connection */
|
|
|
|
if (maxdb_connect_errno()) {
|
|
|
|
printf("Connect failed: %s\n", maxdb_connect_error());
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
$query = "SELECT name, cno from hotel.customer ORDER BY cno";
|
|
|
|
|
|
|
|
if ($result = maxdb_query($link, $query)) {
|
|
|
|
|
|
|
|
/* Get field information for 2nd column */
|
|
|
|
maxdb_field_seek($result, 1);
|
|
|
|
$finfo = maxdb_fetch_field($result);
|
2007-01-29 16:56:02 +00:00
|
|
|
|
2005-01-12 18:53:25 +00:00
|
|
|
printf("Name: %s\n", $finfo->name);
|
|
|
|
printf("Table: %s\n", $finfo->table);
|
|
|
|
printf("max. Len: %d\n", $finfo->max_length);
|
|
|
|
printf("Flags: %d\n", $finfo->flags);
|
|
|
|
printf("Type: %d\n\n", $finfo->type);
|
|
|
|
|
|
|
|
maxdb_free_result($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* close connection */
|
|
|
|
maxdb_close($link);
|
|
|
|
?>
|
|
|
|
]]>
|
2007-01-29 16:56:02 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
2008-06-04 08:18:53 +00:00
|
|
|
&example.outputs.similar;
|
2007-01-29 16:56:02 +00:00
|
|
|
<screen>
|
2005-01-12 18:53:25 +00:00
|
|
|
<![CDATA[
|
|
|
|
Name: NAME
|
|
|
|
Table:
|
|
|
|
max. Len: 10
|
|
|
|
Flags: -1
|
|
|
|
Type: 2
|
|
|
|
]]>
|
2007-01-29 16:56:02 +00:00
|
|
|
</screen>
|
|
|
|
</refsect1>
|
2007-06-16 19:11:13 +00:00
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
|
|
|
<member><function>maxdb_fetch_field</function></member>
|
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2007-01-29 16:56:02 +00:00
|
|
|
</refentry>
|
2005-01-12 18:53:25 +00:00
|
|
|
|
|
|
|
<!-- 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
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2005-01-12 18:53:25 +00:00
|
|
|
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
|
|
|
|
-->
|