I have an sql multiple records INSERT, with an 'id' field set to AUTO_INCREMENT, something like this:
INSERT INTO table1 VALUES (null, "bla"),(null, "bla"),(null, "bla"),(null, "bla") etc..;
and then i have another multiple records INSERT:
INSERT INTO table2 VALUES (null, "bla"),(null, "bla"),(null, "bla"),(null, "bla") etc..;
Now i want the 'id2' of table2 to be the same of table1, but i don't know how to remember all the last_insert_ids from table1 to insert them to table2, if i use LAST_INSERT_ID() it gives me only the 'id' of the first inserted value. Does anyone know how to take all the last_insert_ids?