Re: mysql_insert_id?
| From: | Christian Novak | Date: | Thu, 21 Feb 2002 14:50:45 +0000 |
| Subject: | Re: mysql_insert_id? | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-db+get-17136@lists.php.net to get a copy of this message | ||
"Wee Chua" <Chua@mail.interclean.com> schrieb im Newsbeitrag
news:C823AC1DB499D511BB7C00B0D0F0574C08F28F@serverdell2200.interclean.com...
> Hi,
> Is it possible that I would get the wrong ID (Not the ID I just inserted
in
> Auto_Increment field) by using mysql_insert_id function if someone is also
> inserting record at the same time? How does mysql_insert_id work
accurately?
>
> Thanks,
> Wee
You can get the last auto_inc with the following query:
"SHOW TABLE STATUS 'my_table_having_an_autoinc'"
and then lookup the field "Auto_increment" in the result set.
Best regards
Christian