Salute! I use following raw sql statement in Symfony to insert large number of rows from existing table INTO other table with the same structure, what contains as well a large number of existing rows [because the used tables are dynamically created to runtime, there are NOT SYMFONY-ENTITY]:
$sql_insert = "INSERT INTO table1".$proid." SELECT * from ".$tablename." ON DUPLICATE KEY UPDATE table1".$proid.".id = table1".$proid.".id + 1";
and still getting the same error:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2' for key 'PRIMARY'
It doesn't work for every entry, just only for first inserted entry... Please help me to resolve this problem. How can i update the primary key?