php-doc-en/reference/sesam/functions/sesam-affected-rows.xml
Mehdi Achour e8844eadb3 some more CS
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@146748 c90b9560-bf6c-de11-be94-00142212c4b1
2003-12-18 17:46:56 +00:00

77 lines
2.3 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/sesam.xml, last change in rev 1.1 -->
<refentry id="function.sesam-affected-rows">
<refnamediv>
<refname>sesam_affected_rows</refname>
<refpurpose>
Get number of rows affected by an immediate query
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>sesam_affected_rows</methodname>
<methodparam><type>string</type><parameter>result_id</parameter></methodparam>
</methodsynopsis>
<para>
<parameter>result_id</parameter> is a valid result id returned by
<function>sesam_query</function>.
</para>
<para>
Returns the number of rows affected by a query associated with
<parameter>result_id</parameter>.
</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. The
number returned is the number of affected rows.
</para>
<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>
<para>
See also <function>sesam_query</function> and
<function>sesam_execimm</function>.
</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
-->