php-doc-en/reference/sqlite/functions/sqlite-changes.xml

82 lines
2.2 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<refentry id="function.sqlite-changes">
<refnamediv>
<refname>sqlite_changes</refname>
<refname>SQLiteDatabase->changes</refname>
<refpurpose>
Returns the number of rows that were changed by the most
recent SQL statement
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>sqlite_changes</methodname>
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
</methodsynopsis>
<para>Object oriented style (method):</para>
<classsynopsis>
<ooclass><classname>SQLiteDatabase</classname></ooclass>
<methodsynopsis>
<type>int</type><methodname>changes</methodname>
<void/>
</methodsynopsis>
</classsynopsis>
<para>
Returns the numbers of rows that were changed by the most recent SQL
statement executed against the <parameter>dbhandle</parameter> database
handle.
</para>
<para>
<example>
<title><function>sqlite_changes</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$dbhandle = sqlite_open('mysqlitedb');
$query = sqlite_query($dbhandle, "UPDATE users SET email='jDoe@example.com' WHERE username='jDoe'");
if (!$query) {
exit('Error in query.');
} else {
echo 'Number of rows modified: ', sqlite_changes($dbhandle);
}
/* OO Example */
$dbhandle = new SQLiteDatabase('mysqlitedb');
$query = $dbhandle->query("UPDATE users SET email='jDoe@example.com' WHERE username='jDoe'");
if (!$query) {
exit('Error in query.');
} else {
echo 'Number of rows modified: ', $dbhandle->changes();
}
?>]]>
</programlisting>
</example>
</para>
<para>
See also <function>sqlite_num_rows</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
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
-->