Is there a way to grab all the insert ids ( using $this->db->insert_id() ) from a previously run insert_batch() method?
Ideally it will spit out a simple array of the ids in the order they were inserted.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
creating a trigger would work.
not sure if its gona affect performance on huge batch insertion
it will get all the ids into the table, as you want them in an array write a query which run exactly after the batch and gets all the values from table
last_inserted_idsand then truncate it so that you always have the desired ids after a batch is executed.hope this helps your case.