我有这个测试表:
CREATE TABLE IF NOT EXISTS `test` ( `id_huh` bigint(10) unsigned
NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL DEFAULT
'test', PRIMARY KEY (`id_huh`), KEY `id_huh` (`id_huh`) )
ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
使用这三个插入
INSERT INTO `test` (`id_huh`, `title`) VALUES (NULL, 'test')
INSERT INTO `test` (`id_huh`, `title`) VALUES (0, 'test')
INSERT INTO `test` (`title`) VALUES ('test')
并发行
SELECT LAST_INSERT_ID();
但查询总是导致0.
PHP的mysql_insert_id和PDO :: lastInsertId()也不会产生任何结果.
我一整天都在玩耍,不能让它上班.想法?