Replicate data from database to another database

I am trying to replicate the data from one database to another. Everything else is working but for the code line 119 I am trying to transfer the exact data record but failing to get it replicated. I tried to get it but its multiplying the record with the number of ids and storing in the new database so e.g. if in old database the data is stored against id 17 then in the new database the record is getting multiplied by 17 and storing the record where I just want the original record to be replicated.

edited the picture

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum