mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
removed dead sesam docs
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@255509 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
fad55a8fa1
commit
b8989f5a45
14 changed files with 0 additions and 1884 deletions
|
@ -1,104 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<refentry xml:id="function.sesam-affected-rows" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_affected_rows</refname>
|
||||
<refpurpose>Get number of rows affected by an immediate query</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>sesam_affected_rows</methodname>
|
||||
<methodparam><type>string</type><parameter>result_id</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Gets the number of rows affected by an immediate query.
|
||||
</para>
|
||||
<para>
|
||||
The <function>sesam_affected_rows</function> function can only return
|
||||
useful values when used in combination with "immediate" SQL statements
|
||||
(updating operations like <literal>INSERT</literal>,
|
||||
<literal>UPDATE</literal> and <literal>DELETE</literal>) because SESAM
|
||||
does not deliver any "affected rows" information for "select type"
|
||||
queries.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>result_id</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A valid result id returned by <function>sesam_query</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the number of rows affected by a query associated with
|
||||
<parameter>result_id</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>sesam_affected_rows</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$result = sesam_execimm("DELETE FROM PHONE WHERE LASTNAME = '" . strtoupper($name) . "'");
|
||||
if (!$result) {
|
||||
/* ... error ... */
|
||||
}
|
||||
echo sesam_affected_rows($result).
|
||||
" entries with last name " . $name . " deleted.\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_query</function></member>
|
||||
<member><function>sesam_execimm</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
|
@ -1,85 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry xml:id="function.sesam-commit" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_commit</refname>
|
||||
<refpurpose>Commit pending updates to the SESAM database</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sesam_commit</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Commits any pending updates to the database.
|
||||
</para>
|
||||
<para>
|
||||
Note that there is no "auto-commit" feature as in other
|
||||
databases, as it could lead to accidental data loss. Uncommitted
|
||||
data at the end of the current script (or when calling
|
||||
<function>sesam_disconnect</function>) will be discarded by an
|
||||
implied <function>sesam_rollback</function> call.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Committing an update to the SESAM database</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if (sesam_connect ("mycatalog", "myschema", "otto")) {
|
||||
if (!sesam_execimm ("INSERT INTO mytable VALUES (*, 'Small Test', <0, 8, 15>)"))
|
||||
die("insert failed");
|
||||
if (!sesam_commit())
|
||||
die("commit failed");
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_rollback</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
|
@ -1,122 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry xml:id="function.sesam-connect" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_connect</refname>
|
||||
<refpurpose>Open SESAM database connection</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sesam_connect</methodname>
|
||||
<methodparam><type>string</type><parameter>catalog</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>schema</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>user</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Establishes a connection to a SESAM database handler task. The connection
|
||||
is always "persistent" in the sense that only the very first invocation
|
||||
will actually load the driver from the configured SESAM OML PLAM library.
|
||||
Subsequent calls will reuse the driver and will immediately use the given
|
||||
catalog, schema, and user.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>catalog</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
When creating a database, the <parameter>"catalog"</parameter> name is
|
||||
specified in the SESAM configuration directive
|
||||
<command>//ADD-SQL-DATABASE-CATALOG-LIST ENTRY-1 =
|
||||
*CATALOG(CATALOG-NAME = catalogname,...)</command>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>schema</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <parameter>schema</parameter> references the desired database
|
||||
schema (see SESAM handbook).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>user</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <parameter>"user"</parameter> argument references one of the users
|
||||
which are allowed to access this <parameter>"catalog"</parameter> /
|
||||
<parameter>"schema"</parameter> combination. Note that
|
||||
<parameter>"user"</parameter> is completely independent from both the
|
||||
system's user id's and from HTTP user/password protection. It appears
|
||||
in the SESAM configuration only.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Connect to a SESAM database</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if (!sesam_connect ("mycatalog", "myschema", "otto")) {
|
||||
die("Unable to connect to SESAM");
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_disconnect</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
|
@ -1,191 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<refentry xml:id="function.sesam-diagnostic" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_diagnostic</refname>
|
||||
<refpurpose>Return status information for last SESAM call</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>sesam_diagnostic</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns status information for last SESAM call.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns an associative array of status and return codes for the
|
||||
last SQL query/statement/command. Elements of the array are:
|
||||
<table>
|
||||
<title>
|
||||
Status information returned by <function>sesam_diagnostic</function>
|
||||
</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Element</entry>
|
||||
<entry>Contents</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>$array["sqlstate"]</entry>
|
||||
<entry>
|
||||
5 digit SQL return code (see the SESAM manual for the
|
||||
description of the possible values of SQLSTATE)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>$array["rowcount"]</entry>
|
||||
<entry>
|
||||
number of affected rows in last update/insert/delete (set
|
||||
after "immediate" statements only)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>$array["errmsg"]</entry>
|
||||
<entry>
|
||||
"human readable" error message string (set after errors
|
||||
only)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>$array["errcol"]</entry>
|
||||
<entry>
|
||||
error column number of previous error (0-based; or -1 if
|
||||
undefined. Set after errors only)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>$array["errlin"]</entry>
|
||||
<entry>
|
||||
error line number of previous error (0-based; or -1 if
|
||||
undefined. Set after errors only)
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
In the following example, a syntax error (E SEW42AE ILLEGAL
|
||||
CHARACTER) is displayed by including the offending SQL statement
|
||||
and pointing to the error location:
|
||||
<example>
|
||||
<title>Displaying SESAM error messages with error position</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Function which prints a formatted error message,
|
||||
// displaying a pointer to the syntax error in the
|
||||
// SQL statement
|
||||
function PrintReturncode($exec_str)
|
||||
{
|
||||
$err = Sesam_Diagnostic();
|
||||
$colspan=4; // 4 cols for: sqlstate, errlin, errcol, rowcount
|
||||
if ($err["errlin"] == -1)
|
||||
--$colspan;
|
||||
if ($err["errcol"] == -1)
|
||||
--$colspan;
|
||||
if ($err["rowcount"] == 0)
|
||||
--$colspan;
|
||||
echo "<table border=\"1\">\n";
|
||||
echo "<tr><th colspan=\"" . $colspan . "\"><span class=\"spanred\">ERROR:</span> ".
|
||||
htmlspecialchars($err["errmsg"]) . "</th></tr>\n";
|
||||
if ($err["errcol"] >= 0) {
|
||||
echo "<tr><td colspan=\"" . $colspan . "\"><pre>\n";
|
||||
$errstmt = $exec_str . "\n";
|
||||
for ($lin=0; $errstmt != ""; ++$lin) {
|
||||
if ($lin != $err["errlin"]) { // $lin is less or greater than errlin
|
||||
if (!($i = strchr($errstmt, "\n")))
|
||||
$i = "";
|
||||
$line = substr ($errstmt, 0, strlen($errstmt)-strlen($i)+1);
|
||||
$errstmt = substr($i, 1);
|
||||
if ($line != "\n")
|
||||
echo htmlspecialchars($line);
|
||||
} else {
|
||||
if (! ($i = strchr ($errstmt, "\n")))
|
||||
$i = "";
|
||||
$line = substr ($errstmt, 0, strlen ($errstmt)-strlen($i)+1);
|
||||
$errstmt = substr($i, 1);
|
||||
for ($col=0; $col < $err["errcol"]; ++$col) {
|
||||
echo (substr($line, $col, 1) == "\t") ? "\t" : ".";
|
||||
}
|
||||
echo "<span class=\"spanred\">\\</span>\n";
|
||||
echo "<span class=\"normal\">" . htmlspecialchars($line) . "</span>";
|
||||
for ($col=0; $col < $err["errcol"]; ++$col) {
|
||||
echo (substr ($line, $col, 1) == "\t") ? "\t" : ".";
|
||||
}
|
||||
echo "<span class=\"spanred\">/</span>\n";
|
||||
}
|
||||
}
|
||||
echo "</pre></td></tr>\n";
|
||||
}
|
||||
echo "<tr>\n";
|
||||
echo " <td>sqlstate=" . $err["sqlstate"] . "</td>\n";
|
||||
if ($err["errlin"] != -1)
|
||||
echo " <td>errlin=" . $err["errlin"] . "</td>\n";
|
||||
if ($err["errcol"] != -1)
|
||||
echo " <td>errcol=" . $err["errcol"] . "</td>\n";
|
||||
if ($err["rowcount"] != 0)
|
||||
echo " <td>rowcount=" . $err["rowcount"] . "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
}
|
||||
|
||||
if (!sesam_connect ("mycatalog", "phoneno", "otto"))
|
||||
die ("cannot connect");
|
||||
|
||||
$stmt = "SELECT * FROM phone\n" .
|
||||
" WHERE@ LASTNAME='KRAEMER'\n" .
|
||||
" ORDER BY FIRSTNAME";
|
||||
if (!($result = sesam_query ($stmt)))
|
||||
PrintReturncode ($stmt);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_errormsg</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
|
@ -1,91 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<refentry xml:id="function.sesam-disconnect" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_disconnect</refname>
|
||||
<refpurpose>Detach from SESAM connection</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sesam_disconnect</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Closes the logical link to a SESAM database (without actually
|
||||
disconnecting and unloading the driver).
|
||||
</para>
|
||||
<para>
|
||||
Note that this isn't usually necessary, as the open connection is
|
||||
automatically closed at the end of the script's execution.
|
||||
Uncommitted data will be discarded, because an implicit
|
||||
<function>sesam_rollback</function> is executed.
|
||||
</para>
|
||||
<para>
|
||||
<function>sesam_disconnect</function> will not close the
|
||||
persistent link, it will only invalidate the currently defined
|
||||
<parameter>"catalog"</parameter>, <parameter>"schema"</parameter>
|
||||
and <parameter>"user"</parameter> triple, so that any sesam
|
||||
function called after <function>sesam_disconnect</function> will
|
||||
fail.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Always returns &true;.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Closing a SESAM connection</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if (sesam_connect ("mycatalog", "myschema", "otto")) {
|
||||
/* ... some queries and stuff ... */
|
||||
sesam_disconnect();
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_connect</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
|
@ -1,76 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry xml:id="function.sesam-errormsg" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_errormsg</refname>
|
||||
<refpurpose>Returns error message of last SESAM call</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>sesam_errormsg</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Gets the SESAM error message associated with the most recent SESAM error.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the SESAM error message associated with the most recent SESAM
|
||||
error. An empty string means no errors.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>sesam_errormsg</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if (!sesam_execimm($stmt)) {
|
||||
echo sesam_errormsg() . "<br />\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_diagnostic</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
|
@ -1,114 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry xml:id="function.sesam-execimm" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_execimm</refname>
|
||||
<refpurpose>Execute an "immediate" SQL-statement</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>sesam_execimm</methodname>
|
||||
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Executes an "immediate" statement.
|
||||
</para>
|
||||
<para>
|
||||
Sets the <parameter>affected_rows</parameter> value for retrieval by the
|
||||
<function>sesam_affected_rows</function> function.
|
||||
</para>
|
||||
<para>
|
||||
Note that <function>sesam_query</function> can handle both "immediate" and
|
||||
"select-type" queries. Use <function>sesam_execimm</function> only if you
|
||||
know beforehand what type of statement will be executed. An attempt to
|
||||
use SELECT type queries with <function>sesam_execimm</function> will
|
||||
return <literal>$err["sqlstate"] == "42SBW"</literal>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>query</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An "immediate" statement (i.e., a statement like UPDATE, INSERT or
|
||||
DELETE which returns no result, and has no INPUT or OUTPUT variables).
|
||||
"select type" queries can not be used with
|
||||
<function>sesam_execimm</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns a SESAM result identifier on success, or &false; on error.
|
||||
</para>
|
||||
<para>
|
||||
The returned "result identifier" can not be used for retrieving anything
|
||||
but the <function>sesam_affected_rows</function>; it is only returned for
|
||||
symmetry with the <function>sesam_query</function> function.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>sesam_execimm</function> Example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$stmt = "INSERT INTO mytable VALUES ('one', 'two')";
|
||||
$result = sesam_execimm($stmt);
|
||||
$err = sesam_diagnostic();
|
||||
echo "sqlstate = " . $err["sqlstate"] . "\n".
|
||||
"Affected rows = " . $err["rowcount"] . " == " .
|
||||
sesam_affected_rows($result) . "\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_query</function></member>
|
||||
<member><function>sesam_affected_rows</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
|
@ -1,256 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<refentry xml:id="function.sesam-fetch-array" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_fetch_array</refname>
|
||||
<refpurpose>Fetch one row as an associative array</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>sesam_fetch_array</methodname>
|
||||
<methodparam><type>string</type><parameter>result_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>whence</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>sesam_fetch_array</function> is an alternative version
|
||||
of <function>sesam_fetch_row</function>. Instead of storing the
|
||||
data in the numeric indices of the result array, it stores the
|
||||
data in associative indices, using the field names as keys.
|
||||
</para>
|
||||
<para>
|
||||
<function>sesam_fetch_array</function> fetches one row of data
|
||||
from the result associated with the specified result identifier.
|
||||
The row is returned as an associative array. Each result column
|
||||
is stored with an associative index equal to its column
|
||||
(aka. field) name. The column names are converted to lower case.
|
||||
</para>
|
||||
<para>
|
||||
Columns without a field name (e.g., results of arithmetic
|
||||
operations) and empty fields are not stored in the array. Also,
|
||||
if two or more columns of the result have the same column names,
|
||||
the later column will take precedence. In this situation, either
|
||||
call <function>sesam_fetch_row</function> or make an alias for
|
||||
the column.
|
||||
<informalexample>
|
||||
<programlisting role="sesam">
|
||||
<![CDATA[
|
||||
SELECT TBL1.COL AS FOO, TBL2.COL AS BAR FROM TBL1, TBL2
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
A special handling allows fetching "multiple field" columns
|
||||
(which would otherwise all have the same column names). For each
|
||||
column of a "multiple field", the index name is constructed by
|
||||
appending the string "(n)" where n is the sub-index of the
|
||||
multiple field column, ranging from 1 to its declared repetition
|
||||
factor. The indices are NOT zero based, in order to match the
|
||||
nomenclature used in the respective query syntax. For a column
|
||||
declared as:
|
||||
<informalexample>
|
||||
<programlisting role="sesam">
|
||||
<![CDATA[
|
||||
CREATE TABLE ... ( ... MULTI(3) INT )
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
the associative indices used for the individual "multiple field"
|
||||
columns would be <literal>"multi(1)"</literal>,
|
||||
<literal>"multi(2)"</literal>, and <literal>"multi(3)"</literal>
|
||||
respectively.
|
||||
</para>
|
||||
<para>
|
||||
Subsequent calls to <function>sesam_fetch_array</function> would
|
||||
return the next (or prior, or n'th next/prior, depending on the
|
||||
scroll attributes) row in the result set, or &false; if there are no more rows.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>result_id</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A valid result id returned by <function>sesam_query</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>whence</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<parameter>whence</parameter> is an optional
|
||||
parameter for a fetch operation on "scrollable" cursors, which
|
||||
can be set to the following predefined constants:
|
||||
<table>
|
||||
<title>Valid values for <parameter>"whence"</parameter> parameter</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Value</entry>
|
||||
<entry>Constant</entry>
|
||||
<entry>Meaning</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>0</entry>
|
||||
<entry><constant>SESAM_SEEK_NEXT</constant></entry>
|
||||
<entry>
|
||||
read sequentially (after fetch, the internal default is set
|
||||
to <constant>SESAM_SEEK_NEXT</constant>)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry><constant>SESAM_SEEK_PRIOR</constant></entry>
|
||||
<entry>
|
||||
read sequentially backwards (after fetch, the internal
|
||||
default is set to <constant>SESAM_SEEK_PRIOR</constant>)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry><constant>SESAM_SEEK_FIRST</constant></entry>
|
||||
<entry>
|
||||
rewind to first row (after fetch, the default is set to
|
||||
<constant>SESAM_SEEK_NEXT</constant>)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>3</entry>
|
||||
<entry><constant>SESAM_SEEK_LAST</constant></entry>
|
||||
<entry>
|
||||
seek to last row (after fetch, the default is set to
|
||||
<constant>SESAM_SEEK_PRIOR</constant>)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>4</entry>
|
||||
<entry><constant>SESAM_SEEK_ABSOLUTE</constant></entry>
|
||||
<entry>
|
||||
seek to absolute row number given as
|
||||
<parameter>offset</parameter> (Zero-based. After fetch, the
|
||||
internal default is set to
|
||||
<constant>SESAM_SEEK_ABSOLUTE</constant>, and the internal
|
||||
offset value is auto-incremented)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>5</entry>
|
||||
<entry><constant>SESAM_SEEK_RELATIVE</constant></entry>
|
||||
<entry>
|
||||
seek relative to current scroll position, where
|
||||
<parameter>offset</parameter> can be a positive or negative
|
||||
offset value.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
This parameter is only valid for "scrollable" cursors.
|
||||
</para>
|
||||
<para>
|
||||
When using "scrollable" cursors, the cursor can be freely positioned
|
||||
on the result set. If the <parameter>whence</parameter> parameter is
|
||||
omitted, the global default values for the scrolling type (initialized
|
||||
to: <constant>SESAM_SEEK_NEXT</constant>, and settable by
|
||||
<function>sesam_seek_row</function>) are used. If
|
||||
<parameter>whence</parameter> is supplied, its value replaces the
|
||||
global default.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>offset</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Only evaluated (and required) if <parameter>whence</parameter> is
|
||||
either <constant>SESAM_SEEK_RELATIVE</constant> or
|
||||
<constant>SESAM_SEEK_ABSOLUTE</constant>. This parameter is only
|
||||
valid for "scrollable" cursors.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns an array that corresponds to the fetched row, or
|
||||
&false; if there are no more rows.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>SESAM fetch array</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$result = sesam_query("SELECT * FROM phone\n" .
|
||||
" WHERE LASTNAME='" . strtoupper($name) . "'\n".
|
||||
" ORDER BY FIRSTNAME", 1);
|
||||
if (!$result) {
|
||||
/* ... error ... */
|
||||
}
|
||||
// print the table:
|
||||
echo "<table border=\"1\">\n";
|
||||
while (($row = sesam_fetch_array($result)) && count($row) > 0) {
|
||||
echo "<tr>\n";
|
||||
echo "<td>" . htmlspecialchars($row["firstname"]) . "</td>\n";
|
||||
echo "<td>" . htmlspecialchars($row["lastname"]) . "</td>\n";
|
||||
echo "<td>" . htmlspecialchars($row["phoneno"]) . "</td>\n";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
sesam_free_result($result);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_fetch_row</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
|
@ -1,149 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry xml:id="function.sesam-fetch-result" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_fetch_result</refname>
|
||||
<refpurpose>Return all or part of a query result</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>sesam_fetch_result</methodname>
|
||||
<methodparam><type>string</type><parameter>result_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>max_rows</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Fetches a result, optionally limited to <parameter>max_rows</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>result_id</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A valid result id returned by <function>sesam_query</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>max_rows</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Note that the amount of memory used up by a large query may be
|
||||
gigantic. Use the <parameter>max_rows</parameter> parameter to
|
||||
limit the maximum number of rows returned, unless you are
|
||||
absolutely sure that your result will not use up all available
|
||||
memory.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns a mixed array with the query result entries, optionally
|
||||
limited to a maximum of <parameter>max_rows</parameter> rows.
|
||||
Note that both row and column indexes are zero-based.
|
||||
<table>
|
||||
<title>
|
||||
Mixed result set returned by <function>sesam_fetch_result</function>
|
||||
</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Array Element</entry>
|
||||
<entry>Contents</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>int $arr["count"]</entry>
|
||||
<entry>
|
||||
number of columns in result set (or zero if this was an
|
||||
"immediate" query)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>int $arr["rows"]</entry>
|
||||
<entry>
|
||||
number of rows in result set (between zero and
|
||||
<parameter>max_rows</parameter>)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>bool $arr["truncated"]</entry>
|
||||
<entry>
|
||||
&true; if the number of rows was at least
|
||||
<parameter>max_rows</parameter>, &false;
|
||||
otherwise. Note that even when this is
|
||||
&true;, the next
|
||||
<function>sesam_fetch_result</function> call may return zero
|
||||
rows because there are no more result entries.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>mixed $arr[col][row]</entry>
|
||||
<entry>
|
||||
result data for all the fields at
|
||||
row(<literal>row</literal>) and
|
||||
column(<literal>col</literal>), (where the integer index
|
||||
<literal>row</literal> is between 0 and
|
||||
<literal>$arr["rows"]-1</literal>, and
|
||||
<literal>col</literal> is between 0 and
|
||||
<literal>$arr["count"]-1</literal>). Fields may be empty, so
|
||||
you must check for the existence of a field by using the php
|
||||
<function>isset</function> function. The type of the
|
||||
returned fields depend on the respective SQL type declared
|
||||
for its column (see <link linkend="ref.sesam">SESAM
|
||||
overview</link> for the conversions applied). SESAM
|
||||
"multiple fields" are "inlined" and treated like a sequence
|
||||
of columns.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_fetch_array</function></member>
|
||||
<member><function>sesam_fetch_row</function></member>
|
||||
<member><function>sesam_query</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
|
@ -1,226 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<refentry xml:id="function.sesam-fetch-row" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_fetch_row</refname>
|
||||
<refpurpose>Fetch one row as an array</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>sesam_fetch_row</methodname>
|
||||
<methodparam><type>string</type><parameter>result_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>whence</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Fetches one row of data from the result associated with the specified
|
||||
result identifier. The row is returned as an array (indexed by values
|
||||
between <literal>0</literal> and <literal>$array["count"]-1</literal>).
|
||||
Fields may be empty, so you must check for the existence of a field by
|
||||
using the <function>isset</function> function. The type of the returned
|
||||
fields depend on the respective SQL type declared for its column (see
|
||||
<link linkend="ref.sesam">SESAM overview</link> for the conversions
|
||||
applied). SESAM "multiple fields" are "inlined" and treated like a
|
||||
sequence of columns.
|
||||
</para>
|
||||
<para>
|
||||
The number of columns in the result set is returned in an associative
|
||||
array element $array["count"]. Because some of the result columns may be
|
||||
empty, the <function>count</function> function can not be used on the
|
||||
result row returned by <function>sesam_fetch_row</function>.
|
||||
</para>
|
||||
<para>
|
||||
Subsequent calls to <function>sesam_fetch_row</function> would return the
|
||||
next (or prior, or n'th next/prior, depending on the scroll attributes)
|
||||
row in the result set, or &false; if there are no more rows.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>result_id</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A valid result id returned by <function>sesam_query</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>whence</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<parameter>whence</parameter> is an optional
|
||||
parameter for a fetch operation on "scrollable" cursors, which
|
||||
can be set to the following predefined constants:
|
||||
<table>
|
||||
<title>Valid values for <parameter>"whence"</parameter> parameter</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Value</entry>
|
||||
<entry>Constant</entry>
|
||||
<entry>Meaning</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>0</entry>
|
||||
<entry><constant>SESAM_SEEK_NEXT</constant></entry>
|
||||
<entry>
|
||||
read sequentially (after fetch, the internal default is set
|
||||
to <constant>SESAM_SEEK_NEXT</constant>)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry><constant>SESAM_SEEK_PRIOR</constant></entry>
|
||||
<entry>
|
||||
read sequentially backwards (after fetch, the internal
|
||||
default is set to <constant>SESAM_SEEK_PRIOR</constant>)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry><constant>SESAM_SEEK_FIRST</constant></entry>
|
||||
<entry>
|
||||
rewind to first row (after fetch, the default is set to
|
||||
<constant>SESAM_SEEK_NEXT</constant>)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>3</entry>
|
||||
<entry><constant>SESAM_SEEK_LAST</constant></entry>
|
||||
<entry>
|
||||
seek to last row (after fetch, the default is set to
|
||||
<constant>SESAM_SEEK_PRIOR</constant>)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>4</entry>
|
||||
<entry><constant>SESAM_SEEK_ABSOLUTE</constant></entry>
|
||||
<entry>
|
||||
seek to absolute row number given as
|
||||
<parameter>offset</parameter> (Zero-based. After fetch, the
|
||||
internal default is set to
|
||||
<constant>SESAM_SEEK_ABSOLUTE</constant>, and the internal
|
||||
offset value is auto-incremented)
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>5</entry>
|
||||
<entry><constant>SESAM_SEEK_RELATIVE</constant></entry>
|
||||
<entry>
|
||||
seek relative to current scroll position, where
|
||||
<parameter>offset</parameter> can be a positive or negative
|
||||
offset value.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
This parameter is only valid for "scrollable" cursors.
|
||||
</para>
|
||||
<para>
|
||||
When using "scrollable" cursors, the cursor can be freely positioned
|
||||
on the result set. If the <parameter>whence</parameter> parameter is
|
||||
omitted, the global default values for the scrolling type (initialized
|
||||
to: <constant>SESAM_SEEK_NEXT</constant>, and settable by
|
||||
<function>sesam_seek_row</function>) are used. If
|
||||
<parameter>whence</parameter> is supplied, its value replaces the
|
||||
global default.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>offset</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Only evaluated (and required) if <parameter>whence</parameter> is
|
||||
either <constant>SESAM_SEEK_RELATIVE</constant> or
|
||||
<constant>SESAM_SEEK_ABSOLUTE</constant>. This parameter is only
|
||||
valid for "scrollable" cursors.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns an array that corresponds to the fetched row, or
|
||||
&false; if there are no more rows.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>SESAM fetch rows</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$result = sesam_query("SELECT * FROM phone\n" .
|
||||
" WHERE LASTNAME='" . strtoupper($name) . "'\n" .
|
||||
" ORDER BY FIRSTNAME", 1);
|
||||
if (!$result) {
|
||||
/* ... error ... */
|
||||
}
|
||||
// print the table in backward order
|
||||
echo "<table border=\"1\">\n";
|
||||
$row = sesam_fetch_row($result, SESAM_SEEK_LAST);
|
||||
while (is_array($row)) {
|
||||
echo "<tr>\n";
|
||||
for ($col = 0; $col < $row["count"]; ++$col) {
|
||||
echo "<td>" . htmlspecialchars($row[$col]) . "</td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
// use implied SESAM_SEEK_PRIOR
|
||||
$row = sesam_fetch_row($result);
|
||||
}
|
||||
echo "</table>\n";
|
||||
sesam_free_result($result);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_fetch_array</function></member>
|
||||
<member><function>sesam_fetch_result</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
|
@ -1,235 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<refentry xml:id="function.sesam-field-array" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_field_array</refname>
|
||||
<refpurpose>Return meta information about individual columns in a result</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>sesam_field_array</methodname>
|
||||
<methodparam><type>string</type><parameter>result_id</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns a mixed associative/indexed array with meta information (column
|
||||
name, type, precision, ...) about individual columns of the result after
|
||||
the query associated with <parameter>result_id</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>result_id</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A valid result id returned by <function>sesam_query</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<table>
|
||||
<title>
|
||||
Mixed result set returned by <function>sesam_field_array</function>
|
||||
</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Array Element</entry>
|
||||
<entry>Contents</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>int $arr["count"]</entry>
|
||||
<entry>
|
||||
Total number of columns in result set (or zero if this was
|
||||
an "immediate" query). SESAM "multiple fields" are
|
||||
"inlined" and treated like the respective number of columns.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>string $arr[col]["name"]</entry>
|
||||
<entry>
|
||||
column name for column(<literal>col</literal>), where
|
||||
<literal>col</literal> is between 0 and
|
||||
<literal>$arr["count"]-1</literal>. The returned value can
|
||||
be the empty string (for dynamically computed
|
||||
columns). SESAM "multiple fields" are "inlined" and treated
|
||||
like the respective number of columns, each with the same
|
||||
column name.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>string $arr[col]["count"]</entry>
|
||||
<entry>
|
||||
The "count" attribute describes the repetition factor when
|
||||
the column has been declared as a "multiple field". Usually,
|
||||
the "count" attribute is 1. The first column of a "multiple
|
||||
field" column however contains the number of repetitions
|
||||
(the second and following column of the "multiple field"
|
||||
contain a "count" attribute of 1). This can be used to
|
||||
detect "multiple fields" in the result set. See the example
|
||||
shown in the <function>sesam_query</function> description
|
||||
for a sample use of the "count" attribute.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>string $arr[col]["type"]</entry>
|
||||
<entry><para>
|
||||
PHP variable type of the data for
|
||||
column(<literal>col</literal>), where <literal>col</literal>
|
||||
is between 0 and <literal>$arr["count"]-1</literal>. The
|
||||
returned value can be one of
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara><type>integer</type></simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><type>float</type></simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara><type>string</type></simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
depending on the SQL type of the result. SESAM "multiple
|
||||
fields" are "inlined" and treated like the respective number
|
||||
of columns, each with the same PHP type.
|
||||
</para>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>string $arr[col]["sqltype"]</entry>
|
||||
<entry><para>
|
||||
SQL variable type of the column data for
|
||||
column(<literal>col</literal>), where <literal>col</literal>
|
||||
is between 0 and <literal>$arr["count"]-1</literal>. The
|
||||
returned value can be one of
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>"CHARACTER"</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>"VARCHAR"</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>"NUMERIC"</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>"DECIMAL"</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>"INTEGER"</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>"SMALLINT"</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>"FLOAT"</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>"REAL"</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>"DOUBLE"</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>"DATE"</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>"TIME"</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>"TIMESTAMP"</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
describing the SQL type of the result. SESAM "multiple
|
||||
fields" are "inlined" and treated like the respective number
|
||||
of columns, each with the same SQL type.
|
||||
</para>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>string $arr[col]["length"]</entry>
|
||||
<entry>
|
||||
The SQL "length" attribute of the SQL variable in
|
||||
column(<literal>col</literal>), where <literal>col</literal>
|
||||
is between 0 and <literal>$arr["count"]-1</literal>. The
|
||||
"length" attribute is used with "CHARACTER" and "VARCHAR"
|
||||
SQL types to specify the (maximum) length of the string
|
||||
variable. SESAM "multiple fields" are "inlined" and treated
|
||||
like the respective number of columns, each with the same
|
||||
length attribute.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>string $arr[col]["precision"]</entry>
|
||||
<entry>
|
||||
The "precision" attribute of the SQL variable in
|
||||
column(<literal>col</literal>), where <literal>col</literal>
|
||||
is between 0 and <literal>$arr["count"]-1</literal>. The
|
||||
"precision" attribute is used with numeric and time data
|
||||
types. SESAM "multiple fields" are "inlined" and treated
|
||||
like the respective number of columns, each with the same
|
||||
precision attribute.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>string $arr[col]["scale"]</entry>
|
||||
<entry>
|
||||
The "scale" attribute of the SQL variable in
|
||||
column(<literal>col</literal>), where <literal>col</literal>
|
||||
is between 0 and <literal>$arr["count"]-1</literal>. The
|
||||
"scale" attribute is used with numeric data types. SESAM
|
||||
"multiple fields" are "inlined" and treated like the
|
||||
respective number of columns, each with the same scale
|
||||
attribute.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_query</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
|
@ -1,88 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry xml:id="function.sesam-field-name" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_field_name</refname>
|
||||
<refpurpose>Return one column name of the result set</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>sesam_field_name</methodname>
|
||||
<methodparam><type>string</type><parameter>result_id</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>index</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Gets the field name.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>result_id</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A valid result id returned by <function>sesam_query</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>index</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The column index is zero-based, not one-based as in SESAM.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the name of a field in the result set, or &false; on error.
|
||||
</para>
|
||||
<para>
|
||||
For "immediate" queries, or for dynamic columns, an empty string
|
||||
is returned.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_field_array</function>. It provides an
|
||||
easier interface to access the column names and types, and allows
|
||||
for detection of "multiple fields".</member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
|
@ -1,63 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry xml:id="function.sesam-free-result" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_free_result</refname>
|
||||
<refpurpose>Releases resources for the query</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>sesam_free_result</methodname>
|
||||
<methodparam><type>string</type><parameter>result_id</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Releases resources for the query.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>result_id</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A valid result id returned by <function>sesam_query</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</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
|
||||
-->
|
|
@ -1,84 +0,0 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry xml:id="function.sesam-num-fields" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>sesam_num_fields</refname>
|
||||
<refpurpose>Return the number of fields/columns in a result set</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>sesam_num_fields</methodname>
|
||||
<methodparam><type>string</type><parameter>result_id</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
After calling <function>sesam_query</function> with a "select
|
||||
type" query, this function gives you the number of columns in the
|
||||
result.
|
||||
</para>
|
||||
<para>
|
||||
For "immediate" statements, the value zero is returned. The SESAM
|
||||
"multiple field" columns count as their respective dimension,
|
||||
i.e., a three-column "multiple field" counts as three columns.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>result_id</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A valid result id returned by <function>sesam_query</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns an integer describing the total number of columns (aka. fields) in
|
||||
the current <parameter>result_id</parameter> result set or &false; on
|
||||
error.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>sesam_query</function></member>
|
||||
<member><function>sesam_field_array</function> for a way to distinguish
|
||||
between "multiple field" columns and regular columns.</member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
Loading…
Reference in a new issue