Upon doing batch insertion in PHP instead of last row 2nd last row is getting duplicated and actual last row is not getting inserted
I am doing batch insertion in the below code, extracting data from a database and inserting to another source, the data is getting inserted completely except the last row. The 2nd last row is getting duplicated instead.