Updating mysql-insert-id documentation. More clearly explains why bigint will fail.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@288440 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Brandon Savage 2009-09-18 18:04:29 +00:00
parent 40e627107e
commit 05d68e4ea4
2 changed files with 9 additions and 10 deletions

View file

@ -212,9 +212,8 @@ class b implements a
<para>
An interface, together with type-hinting, provides a good way to make sure
that a particular object contains particular methods. See
<link linkend="language.operators.type">instanceof</link> and
<link linkend="language.operators.type">instanceof</link> operator and
<link linkend="language.oop5.typehinting">type hinting</link>.
operator.
</para>
</sect2>

View file

@ -64,14 +64,14 @@ printf("Last inserted record has id %d\n", mysql_insert_id());
&reftitle.notes;
<caution>
<para>
<function>mysql_insert_id</function> converts the return type of
the native MySQL C API function
<literal>mysql_insert_id()</literal> to a type of
<literal>long</literal> (named <type>int</type> in PHP).
If your AUTO_INCREMENT column has a column type of BIGINT,
the value returned by <function>mysql_insert_id</function>
will be incorrect. Instead, use the internal MySQL SQL function
<literal>LAST_INSERT_ID()</literal> in an SQL query.
<function>mysql_insert_id</function> will convert the return type of the
native MySQL C API function <literal>mysql_insert_id()</literal> to a type
of <literal>long</literal> (named <type>int</type> in PHP). If your
AUTO_INCREMENT column has a column type of BIGINT (64 bits) the
conversion may result in an incorrect value. Instead, use the internal
MySQL SQL function LAST_INSERT_ID() in an SQL query. For more information
about PHP's maximum integer values, please see the
<link linkend="language.types.integer">integer</link> documentation.
</para>
</caution>
<note>