cvs: peardoc /en/package/database/mdb2 intro-sequences.xml
| From: | Lukas Smith | Date: | Mon, 30 Oct 2006 18:30:39 +0000 |
| Subject: | cvs: peardoc /en/package/database/mdb2 intro-sequences.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-8678@lists.php.net to get a copy of this message | ||
lsmith Mon Oct 30 18:30:39 2006 UTC
Modified files:
/peardoc/en/package/database/mdb2 intro-sequences.xml
Log:
- minor tweaks
- added docs for currID()
http://cvs.php.net/viewvc.cgi/peardoc/en/package/database/mdb2/intro-sequences.xml?r1=1.13&r2=1.14&diff_format=u
Index: peardoc/en/package/database/mdb2/intro-sequences.xml
diff -u peardoc/en/package/database/mdb2/intro-sequences.xml:1.13
peardoc/en/package/database/mdb2/intro-sequences.xml:1.14
--- peardoc/en/package/database/mdb2/intro-sequences.xml:1.13 Tue Sep 26 08:44:53 2006
+++ peardoc/en/package/database/mdb2/intro-sequences.xml Mon Oct 30 18:30:39 2006
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
-<!-- $Revision: 1.13 $ -->
+<!-- $Revision: 1.14 $ -->
<refentry id="package.database.mdb2.intro-sequences">
<refnamediv>
@@ -113,16 +113,16 @@
<para>
<example>
- <title>Using lastInsertId()</title>
+ <title>Using lastInsertID()</title>
<programlisting role="php">
<![CDATA[
<?php
// Once you have a valid MDB2 object named $mdb2...
$res =& $mdb2->query("INSERT INTO myTable (id, text) VALUES (NULL,
'foo')");
-// optionally pass in a table and fieldname in order to call nextId()
+// optionally pass in a table and fieldname in order to call nextID()
// when autoincrement is not supported
-$id = $mdb2->lastInsertId('myTable', 'id');
+$id = $mdb2->lastInsertID('myTable', 'id');
if (PEAR::isError($id)) {
die($id->getMessage());
}
@@ -134,6 +134,33 @@
</para>
</refsect1>
+ <refsect1 id="package.database.mdb2.intro-sequences.currid">
+ <title>Getting the current ID</title>
+ <para>
+ If you can get the current global value of a sequence using the
+ <ulink url="http://pear.php.net/package/MDB2/docs/latest/MDB2/MDB2_Driver_Common.html#methodcurrID">
+ <function>currID</function></ulink> method.
+ </para>
+
+ <para>
+ <example>
+ <title>Using currID()</title>
+ <programlisting role="php">
+ <![CDATA[
+<?php
+
+// getting the current value of a sequence
+$id = $mdb2->currID('myseq');
+if (PEAR::isError($id)) {
+ die($id->getMessage());
+}
+
+?>
+ ]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
<refsect1 id="package.database.mdb2.intro-sequences.getbeforeid">
<title>Getting around emulation</title>
@@ -151,7 +178,7 @@
<para>
<example>
- <title>Using getBeforeId()/getAfterId()</title>
+ <title>Using getBeforeID()/getAfterID()</title>
<programlisting role="php">
<![CDATA[
<?php