MySQL: LAST_INSERT_ID() returns 0

前端 未结 6 1538
天涯浪人
天涯浪人 2020-11-30 07:28

I\'ve got this test table:

CREATE TABLE IF NOT EXISTS `test` (
    `id` INT(10) AUTO_INCREMENT,
    PRIMARY KEY (`id         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 08:00

    The problem seemed to be in MySQL's phpmyadmin config file PersistentConnections set to FALSE which resulted in a new CONNECTION_ID every time a query was issued - therefore rendering SELECT LAST_INSERT_ID() ineffective.

    more info in the subsequent topic Every query creates a new CONNECTION_ID()

    Also thanks dnagirl for help

提交回复
热议问题