Home >Backend Development >PHP Tutorial >MYSQL tips -- LAST_INSERT_ID

MYSQL tips -- LAST_INSERT_ID

WBOY
WBOYOriginal
2016-07-25 09:10:59987browse
MYSQL Tips -- LAST_INSERT_ID                  
                                                                                                                                                                                                                                                                                                       



Use PHP to call mysql. The built-in LAST_INSERT_ID() function may not be used by many people. The most used one is mysql_insert_id();
In fact, there is a difference between the two. LAST_INSERT_ID() can return bigint value id. However, mysql_insert_id returns int. If your id is unsigned int, or bigint. So, maybe what is returned is wrong. Use LAST_INSERT_ID() instead.
  1. Copy code
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn