2003-06-20 17:31:55 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2005-01-19 22:13:08 +00:00
|
|
|
<!-- $Revision: 1.9 $ -->
|
2003-06-20 18:57:15 +00:00
|
|
|
<refentry id="function.sqlite-changes">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>sqlite_changes</refname>
|
2005-01-12 08:56:59 +00:00
|
|
|
<refname>SQLiteDatabase->changes</refname>
|
2003-07-06 04:43:08 +00:00
|
|
|
<refpurpose>
|
|
|
|
Returns the number of rows that were changed by the most
|
2004-07-27 04:48:55 +00:00
|
|
|
recent SQL statement
|
2003-07-06 04:43:08 +00:00
|
|
|
</refpurpose>
|
2003-06-20 18:57:15 +00:00
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>int</type><methodname>sqlite_changes</methodname>
|
2003-07-21 16:44:20 +00:00
|
|
|
<methodparam><type>resource</type><parameter>dbhandle</parameter></methodparam>
|
2003-06-20 18:57:15 +00:00
|
|
|
</methodsynopsis>
|
2005-01-12 08:56:59 +00:00
|
|
|
<para>Object oriented style (method):</para>
|
|
|
|
<classsynopsis>
|
|
|
|
<ooclass><classname>SQLiteDatabase</classname></ooclass>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>int</type><methodname>changes</methodname>
|
|
|
|
<void/>
|
|
|
|
</methodsynopsis>
|
|
|
|
</classsynopsis>
|
2003-06-20 18:57:15 +00:00
|
|
|
<para>
|
|
|
|
Returns the numbers of rows that were changed by the most recent SQL
|
2003-07-21 16:44:20 +00:00
|
|
|
statement executed against the <parameter>dbhandle</parameter> database
|
|
|
|
handle.
|
2003-06-20 18:57:15 +00:00
|
|
|
</para>
|
2005-01-14 05:42:48 +00:00
|
|
|
<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 */
|
2005-01-19 22:13:08 +00:00
|
|
|
$dbhandle = new SQLiteDatabase('mysqlitedb');
|
2005-01-14 05:42:48 +00:00
|
|
|
$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>
|
2003-07-06 04:43:08 +00:00
|
|
|
<para>
|
|
|
|
See also <function>sqlite_num_rows</function>.
|
|
|
|
</para>
|
2003-06-20 18:57:15 +00:00
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2003-06-20 17:31:55 +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
|
|
|
|
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
|
|
|
|
-->
|