title: Duplicate a record in MySQL
body: <p>I have a table and I want to duplicate specific rows in the table. I know this is not the best way to do things but we are looking for a quick solution.</p>
  
  <p>Here's something harder than I initially thought, all I need to do is copy an entire record to a new record in an auto-increment table in MySql without the need to specify each field. This is because the table can change in future and might break duplication. I will be duplicating MySQL records from PHP.</p>
  
  <p>It is a problem because in a 'SELECT * ' query MySql will try to copy the ID of the record being copied which genenerates a duplicate ID error. </p>
  
  <p>This blocks out:
   <code>INSERT INTO customer SELECT * FROM customer WHERE customerid=9181</code>. It also blocks out <code>INSERT INTO customer (Field1, Field2, ...) SELECT Field1, Field2, ..... FROM customer WHERE customerid=9181.</code></p>
  
  <p>Is there a way to do this from PHP or MySQL?</p>