LAST_INSERT_ID() MySQL

后端 未结 11 2402
花落未央
花落未央 2020-11-22 10:56

I have a MySQL question that I think must be quite easy. I need to return the LAST INSERTED ID from table1 when I run the following MySql query:

INSERT INTO          


        
11条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 11:01

    If you need to have from mysql, after your query, the last auto-incremental id without another query, put in your code:

    mysql_insert_id();
    

提交回复
热议问题