mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
40e627107e
commit
05d68e4ea4
2 changed files with 9 additions and 10 deletions
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue