Take a stab at documenting this based on PDO 0.3 beta release notes.

An actual test case would be nice :)


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@181734 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Dan Scott 2005-03-09 23:29:35 +00:00
parent 7f6967d8f0
commit af7c5f5ccb

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
<refentry id="function.PDO-lastInsertId">
<refnamediv>
@ -11,11 +11,16 @@
<refsect1 role="description">
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>PDO::lastInsertId</methodname>
<void/>
<type>string</type><methodname>PDO::lastInsertId</methodname>
<methodparam choice="opt"><type>string</type><parameter>name</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
&warn.experimental.func;
<para>
Returns the ID of the last inserted row, or the next value from a
sequence object.
</para>
<note>
<para>
Due to differences between database server implementations, this method
@ -24,13 +29,39 @@
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>
Name of the sequence object from which the ID should be returned.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an integer representing the row ID of the last row that was
inserted into the database. If the PDO driver does not support this
capability, <function>PDO::lastInsertID</function> issues a PDOWarning
exception.
If a sequence name was not specified for the <parameter>name</parameter>
parameter, <function>PDOStatement::lastInsertId</function> returns a
string representing the row ID of the last row that was inserted into
the database.
</para>
<para>
If a sequence name was specified for the <parameter>name</parameter>
parameter, <function>PDOStatement::lastInsertId</function> returns a
string representing the next value retrieved from the specified sequence
object.
</para>
<para>
If the PDO driver does not support this capability,
<function>PDO::lastInsertID</function> issues a PDOWarning exception.
</para>
</refsect1>