php-doc-en/reference/mysqli/functions/mysqli-stmt-affected-rows.xml
Georg Richter 8190ee59a5 little docu update
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@150059 c90b9560-bf6c-de11-be94-00142212c4b1
2004-01-28 23:18:42 +00:00

82 lines
2.7 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<refentry id="function.mysqli-stmt-affected-rows">
<refnamediv>
<refname>mysqli_stmt_affected_rows</refname>
<refname>mysqli_stmt->affected_rows</refname>
<refpurpose>Returns the total number of rows changed, deleted, or
inserted by the last executed statement
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<para>Procedural style :</para>
<methodsynopsis>
<type>mixed</type><methodname>mysqli_stmt_affected_rows</methodname>
<methodparam><type>object</type><parameter>stmt</parameter></methodparam>
</methodsynopsis>
<para>Object oriented style (property):</para>
<classsynopsis>
<ooclass><classname>stmt</classname></ooclass>
<fieldsynopsis><type>mixed</type><varname>affected_rows</varname></fieldsynopsis>
</classsynopsis>
<para>
<function>mysqli_stmt_affected_rows</function> returns the number of rows affected
by INSERT, UPDATE, or DELETE query. If the last query was invalid, this function will return -1.
</para>
<note>
<para>
For SELECT statements <function>mysqli_affected_rows</function> works like
<function>mysqli_num_rows</function>.
</para>
</note>
<para>
The <function>mysqli_stmt_affected_rows</function> function only works with queries
which update a table. In order to return the number of rows from a SELECT query, use
the <function>mysqli_stmt_num_rows</function> function instead.
</para>
</refsect1>
<refsect1>
<title>Return Values</title>
<para>
An integer greater than zero indicates the number of rows affected or retrieved.
Zero indicates that no records where updated for an UPDATE/DELETE statement, no
rows matched the WHERE clause in the query or that no query has yet been executed.
-1 indicates that the query has returned an error.
</para>
<note>
<para>
If the number of affected rows is greater than maximal PHP int value, the number of
affected rows will be returned as a string value.
</para>
</note>
</refsect1>
<refsect1>
<title>See also</title>
<para>
<function>mysqli_stmt_num_rows</function>,
<function>mysqli_prepare</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
-->