cvs: phpdoc /en/reference/sqlite3/sqlite3 changes.xml close.xml construct.xml createfunction.xml escapestring.xml exec.xml lasterrorcode.xml
lasterrormsg.xml lastinsertrowid.xml loadextension.xml open.xml prepare.xml query.xml querysingle.xml version.xml
| From: | Scott MacVicar | Date: | Wed, 09 Jul 2008 14:00:00 +0000 |
| Subject: | cvs: phpdoc /en/reference/sqlite3/sqlite3 changes.xml close.xml construct.xml createfunction.xml escapestring.xml exec.xml lasterrorcode.xml lasterrormsg.xml lastinsertrowid.xml loadextension.xml open.xml prepare.xml query.xml querysingle.xml version.xml |
||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-1846@lists.php.net to get a copy of this message | ||
scottmac Wed Jul 9 14:00:00 2008 UTC
Modified files:
/phpdoc/en/reference/sqlite3/sqlite3 changes.xml close.xml
construct.xml
createfunction.xml
escapestring.xml exec.xml
lasterrorcode.xml
lasterrormsg.xml
lastinsertrowid.xml
loadextension.xml open.xml
prepare.xml query.xml
querysingle.xml version.xml
Log:
Add examples and remove the placeholders where appropriate.
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/changes.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/changes.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/changes.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/changes.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/changes.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/changes.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.changes" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -44,16 +44,15 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); + +$query = $db->exec('UPDATE counter SET views=0 WHERE page="test"'); +if ($query) { + echo 'Number of rows modified: ', $db->changes(); +} ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/close.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/close.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/close.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/close.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/close.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/close.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.close" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -38,16 +38,11 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); +$db->close(); ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/construct.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/construct.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/construct.xml:1.3 phpdoc/en/reference/sqlite3/sqlite3/construct.xml:1.4 --- phpdoc/en/reference/sqlite3/sqlite3/construct.xml:1.3 Thu Jul 3 18:21:08 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/construct.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry xml:id="sqlite3.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -94,16 +94,16 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); + +$db->exec('CREATE TABLE foo (bar STRING)'); +$db->exec("INSERT INTO foo (bar) VALUES ('This is a test')"); + +$result = $db->query('SELECT bar FROM foo'); +var_dump($result->fetchArray()); ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/createfunction.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/createfunction.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/createfunction.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/createfunction.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/createfunction.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/createfunction.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.createfunction" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -72,14 +72,21 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +function my_udf_md5($string) { + return md5($string); +} + +$db = new SQLite3('mysqlitedb.db'); +$db->createFunction('my_udf_md5', 'my_udf_md5'); + +var_dump($db->querySingle('SELECT my_udf_md5("test")')); ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ -... +string(32) "098f6bcd4621d373cade4e832627b4f6" ]]> </screen> </example> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/escapestring.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/escapestring.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/escapestring.xml:1.1 phpdoc/en/reference/sqlite3/sqlite3/escapestring.xml:1.2 --- phpdoc/en/reference/sqlite3/sqlite3/escapestring.xml:1.1 Thu Jul 3 03:06:58 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/escapestring.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry xml:id="sqlite3.escapestring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -44,26 +44,15 @@ </para> </refsect1> - <refsect1 role="examples"> - &reftitle.examples; - <para> - <example> - <title><function>SQLite3::escapeString</function> example</title> - <programlisting role="php"> -<![CDATA[ -<?php -/* ... */ -?> -]]> - </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> - </example> - </para> + <refsect1 role="notes"> + &reftitle.notes; + <warning> + <simpara> + <function>addslashes</function> should <emphasis>NOT</emphasis> be used to + quote your strings for SQLite queries; it will lead to strange results + when retrieving your data. + </simpara> + </warning> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/exec.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/exec.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/exec.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/exec.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/exec.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/exec.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.exec" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -51,16 +51,12 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); + +$db->exec('CREATE TABLE bar (bar STRING)'); ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/lasterrorcode.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/lasterrorcode.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/lasterrorcode.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/lasterrorcode.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/lasterrorcode.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/lasterrorcode.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.lasterrorcode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -33,28 +33,6 @@ </para> </refsect1> - <refsect1 role="examples"> - &reftitle.examples; - <para> - <example> - <title><function>SQLite3::lastErrorCode</function> example</title> - <programlisting role="php"> -<![CDATA[ -<?php -/* ... */ -?> -]]> - </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> - </example> - </para> - </refsect1> - </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/lasterrormsg.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/lasterrormsg.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/lasterrormsg.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/lasterrormsg.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/lasterrormsg.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/lasterrormsg.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.lasterrormsg" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -32,28 +32,6 @@ </para> </refsect1> - <refsect1 role="examples"> - &reftitle.examples; - <para> - <example> - <title><function>SQLite3::lastErrorMsg</function> example</title> - <programlisting role="php"> -<![CDATA[ -<?php -/* ... */ -?> -]]> - </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> - </example> - </para> - </refsect1> - </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/lastinsertrowid.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/lastinsertrowid.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/lastinsertrowid.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/lastinsertrowid.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/lastinsertrowid.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/lastinsertrowid.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.lastinsertrowid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -30,28 +30,6 @@ </para> </refsect1> - <refsect1 role="examples"> - &reftitle.examples; - <para> - <example> - <title><function>SQLite3::lastInsertRowID</function> example</title> - <programlisting role="php"> -<![CDATA[ -<?php -/* ... */ -?> -]]> - </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> - </example> - </para> - </refsect1> - </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/loadextension.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/loadextension.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/loadextension.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/loadextension.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/loadextension.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/loadextension.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.loadextension" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -51,16 +51,11 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); +$db->loadExtension('libagg.so'); ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/open.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/open.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/open.xml:1.3 phpdoc/en/reference/sqlite3/sqlite3/open.xml:1.4 --- phpdoc/en/reference/sqlite3/sqlite3/open.xml:1.3 Thu Jul 3 18:21:08 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/open.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry xml:id="sqlite3.open" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -91,16 +91,16 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); + +$db->exec('CREATE TABLE foo (bar STRING)'); +$db->exec("INSERT INTO foo (bar) VALUES ('This is a test')"); + +$result = $db->query('SELECT bar FROM foo'); +var_dump($result->fetchArray()); ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/prepare.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/prepare.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/prepare.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/prepare.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/prepare.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/prepare.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.prepare" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -50,16 +50,20 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +unlink('mysqlitedb.db'); +$db = new SQLite3('mysqlitedb.db'); + +$db->exec('CREATE TABLE foo (id INTEGER, bar STRING)'); +$db->exec("INSERT INTO foo (id, bar) VALUES (1, 'This is a test')"); + +$stmt = $db->prepare('SELECT bar FROM foo WHERE id=:id'); +$stmt->bindValue(':id', 1, SQLITE3_INTEGER); + +$result = $stmt->execute(); +var_dump($result->fetchArray()); ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/query.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/query.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/query.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/query.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/query.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/query.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.query" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -52,16 +52,15 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); + +$results = $db->query('SELECT bar FROM foo'); +while ($row = $results->fetchArray()) { + var_dump($row); +} ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/querysingle.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/querysingle.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/querysingle.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/querysingle.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/querysingle.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/querysingle.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.querysingle" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -62,14 +62,22 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); + +var_dump($db->querySingle('SELECT username FROM user WHERE userid=1')); +print_r($db->querySingle('SELECT username, email FROM user WHERE userid=1', true)); ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ -... +string(5) "Scott" +Array +( + [username] => Scott + [email] => scott@example.com +) ]]> </screen> </example> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/version.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/version.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/version.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/version.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/version.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/version.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.version" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -41,14 +41,18 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +print_r(SQLite3::version()); ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ -... +Array +( + [versionString] => 3.5.9 + [versionNumber] => 3005009 +) ]]> </screen> </example>
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/changes.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/changes.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/changes.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/changes.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/changes.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/changes.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.changes" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -44,16 +44,15 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); + +$query = $db->exec('UPDATE counter SET views=0 WHERE page="test"'); +if ($query) { + echo 'Number of rows modified: ', $db->changes(); +} ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/close.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/close.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/close.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/close.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/close.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/close.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.close" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -38,16 +38,11 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); +$db->close(); ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/construct.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/construct.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/construct.xml:1.3 phpdoc/en/reference/sqlite3/sqlite3/construct.xml:1.4 --- phpdoc/en/reference/sqlite3/sqlite3/construct.xml:1.3 Thu Jul 3 18:21:08 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/construct.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry xml:id="sqlite3.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -94,16 +94,16 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); + +$db->exec('CREATE TABLE foo (bar STRING)'); +$db->exec("INSERT INTO foo (bar) VALUES ('This is a test')"); + +$result = $db->query('SELECT bar FROM foo'); +var_dump($result->fetchArray()); ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/createfunction.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/createfunction.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/createfunction.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/createfunction.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/createfunction.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/createfunction.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.createfunction" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -72,14 +72,21 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +function my_udf_md5($string) { + return md5($string); +} + +$db = new SQLite3('mysqlitedb.db'); +$db->createFunction('my_udf_md5', 'my_udf_md5'); + +var_dump($db->querySingle('SELECT my_udf_md5("test")')); ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ -... +string(32) "098f6bcd4621d373cade4e832627b4f6" ]]> </screen> </example> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/escapestring.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/escapestring.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/escapestring.xml:1.1 phpdoc/en/reference/sqlite3/sqlite3/escapestring.xml:1.2 --- phpdoc/en/reference/sqlite3/sqlite3/escapestring.xml:1.1 Thu Jul 3 03:06:58 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/escapestring.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry xml:id="sqlite3.escapestring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -44,26 +44,15 @@ </para> </refsect1> - <refsect1 role="examples"> - &reftitle.examples; - <para> - <example> - <title><function>SQLite3::escapeString</function> example</title> - <programlisting role="php"> -<![CDATA[ -<?php -/* ... */ -?> -]]> - </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> - </example> - </para> + <refsect1 role="notes"> + &reftitle.notes; + <warning> + <simpara> + <function>addslashes</function> should <emphasis>NOT</emphasis> be used to + quote your strings for SQLite queries; it will lead to strange results + when retrieving your data. + </simpara> + </warning> </refsect1> </refentry> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/exec.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/exec.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/exec.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/exec.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/exec.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/exec.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.exec" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -51,16 +51,12 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); + +$db->exec('CREATE TABLE bar (bar STRING)'); ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/lasterrorcode.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/lasterrorcode.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/lasterrorcode.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/lasterrorcode.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/lasterrorcode.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/lasterrorcode.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.lasterrorcode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -33,28 +33,6 @@ </para> </refsect1> - <refsect1 role="examples"> - &reftitle.examples; - <para> - <example> - <title><function>SQLite3::lastErrorCode</function> example</title> - <programlisting role="php"> -<![CDATA[ -<?php -/* ... */ -?> -]]> - </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> - </example> - </para> - </refsect1> - </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/lasterrormsg.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/lasterrormsg.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/lasterrormsg.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/lasterrormsg.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/lasterrormsg.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/lasterrormsg.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.lasterrormsg" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -32,28 +32,6 @@ </para> </refsect1> - <refsect1 role="examples"> - &reftitle.examples; - <para> - <example> - <title><function>SQLite3::lastErrorMsg</function> example</title> - <programlisting role="php"> -<![CDATA[ -<?php -/* ... */ -?> -]]> - </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> - </example> - </para> - </refsect1> - </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/lastinsertrowid.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/lastinsertrowid.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/lastinsertrowid.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/lastinsertrowid.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/lastinsertrowid.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/lastinsertrowid.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.lastinsertrowid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -30,28 +30,6 @@ </para> </refsect1> - <refsect1 role="examples"> - &reftitle.examples; - <para> - <example> - <title><function>SQLite3::lastInsertRowID</function> example</title> - <programlisting role="php"> -<![CDATA[ -<?php -/* ... */ -?> -]]> - </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> - </example> - </para> - </refsect1> - </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/loadextension.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/loadextension.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/loadextension.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/loadextension.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/loadextension.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/loadextension.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.loadextension" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -51,16 +51,11 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); +$db->loadExtension('libagg.so'); ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/open.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/open.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/open.xml:1.3 phpdoc/en/reference/sqlite3/sqlite3/open.xml:1.4 --- phpdoc/en/reference/sqlite3/sqlite3/open.xml:1.3 Thu Jul 3 18:21:08 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/open.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry xml:id="sqlite3.open" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -91,16 +91,16 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); + +$db->exec('CREATE TABLE foo (bar STRING)'); +$db->exec("INSERT INTO foo (bar) VALUES ('This is a test')"); + +$result = $db->query('SELECT bar FROM foo'); +var_dump($result->fetchArray()); ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/prepare.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/prepare.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/prepare.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/prepare.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/prepare.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/prepare.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.prepare" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -50,16 +50,20 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +unlink('mysqlitedb.db'); +$db = new SQLite3('mysqlitedb.db'); + +$db->exec('CREATE TABLE foo (id INTEGER, bar STRING)'); +$db->exec("INSERT INTO foo (id, bar) VALUES (1, 'This is a test')"); + +$stmt = $db->prepare('SELECT bar FROM foo WHERE id=:id'); +$stmt->bindValue(':id', 1, SQLITE3_INTEGER); + +$result = $stmt->execute(); +var_dump($result->fetchArray()); ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/query.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/query.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/query.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/query.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/query.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/query.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.query" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -52,16 +52,15 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); + +$results = $db->query('SELECT bar FROM foo'); +while ($row = $results->fetchArray()) { + var_dump($row); +} ?> ]]> </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> </example> </para> </refsect1> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/querysingle.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/querysingle.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/querysingle.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/querysingle.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/querysingle.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/querysingle.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.querysingle" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -62,14 +62,22 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +$db = new SQLite3('mysqlitedb.db'); + +var_dump($db->querySingle('SELECT username FROM user WHERE userid=1')); +print_r($db->querySingle('SELECT username, email FROM user WHERE userid=1', true)); ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ -... +string(5) "Scott" +Array +( + [username] => Scott + [email] => scott@example.com +) ]]> </screen> </example> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sqlite3/sqlite3/version.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/sqlite3/sqlite3/version.xml diff -u phpdoc/en/reference/sqlite3/sqlite3/version.xml:1.2 phpdoc/en/reference/sqlite3/sqlite3/version.xml:1.3 --- phpdoc/en/reference/sqlite3/sqlite3/version.xml:1.2 Thu Jul 3 16:31:57 2008 +++ phpdoc/en/reference/sqlite3/sqlite3/version.xml Wed Jul 9 14:00:00 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry xml:id="sqlite3.version" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -41,14 +41,18 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ +print_r(SQLite3::version()); ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ -... +Array +( + [versionString] => 3.5.9 + [versionNumber] => 3005009 +) ]]> </screen> </example>