I have a table and I want to duplicate certain rows in the table. I know that this is not the best way to do something, but we are looking for a quick solution.
Here is something more complex than I originally thought, all I have to do is copy the entire record to the new record in the auto-increment table in MySql without having to specify each field. This is because the table may change in the future and may break duplication. I will duplicate MySQL records from PHP.
This is a problem because in the "SELECT *" query, MySql will try to copy the identifier of the record being copied, which generates a duplicate identification error.
This blocks:
INSERT INTO customer SELECT * FROM customer WHERE customerid=9181. It also blocksINSERT INTO customer (Field1, Field2, ...) SELECT Field1, Field2, ..... FROM customer WHERE customerid=9181.
Is there any way to do this with PHP or MySQL?
Pasta source
share