0

I am using insert_batch() in codeigniter and I want to fetch all insert_id for my insert_batch as insert_id just gives the first inserted id

  • Please add in your post what you have done so far? – d.coder Aug 26 '16 at 07:14
  • 1
    Possible duplicate of [Error in getting the last inserted ID of a query using batch insert in CodeIgniter](http://stackoverflow.com/questions/18372537/error-in-getting-the-last-inserted-id-of-a-query-using-batch-insert-in-codeignit) – devpro Aug 26 '16 at 07:26
  • Count the total rows in array which you are going to insert. `$this->db->insert_id();` This will return the first insert id. Now you can easily find the last insert ids Is this logic clear to you? – Ashu Jha Aug 26 '16 at 07:27
  • Thanks Ashu I have implemented this logic thanks for the commnet – Dev Prajapati Aug 29 '16 at 06:30

0 Answers0