2021年4月30日星期五

How to fix Dublicate Entry Error in Mysql

I have two tables of similar structure with both having an id as primary key and auto increment. I want to copy everything from table 2 into table 1 am and using the following php code.

$query ="INSERT INTO TABLE1 SELECT * FROM TABLE2";

Now I get this error:: Dublicate entry 1 for 'PRIMARY' yet the column id for both tables is set to auto increment

How can I resolve this

https://stackoverflow.com/questions/67342300/how-to-fix-dublicate-entry-error-in-mysql May 01, 2021 at 10:04AM

没有评论:

发表评论