I have problem with LAST_INSERT_ID
.
CREATE TABLE for_test(
id_test INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
test_name VARCHAR(30)
);
INSERT INTO for_test (test_name) VALUES ('test1');
INSERT INTO for_test (test_name) VALUES ('test2');
I added successfully two records - yet SELECT LAST_INSERT_ID()
still returns 0. (I use InnoDB if that even matters)
Could anyone tell me what I'm doing wrong?