How to Duplicate Record In Mysql/Php

admin

Administrator
Staff member
Is there a simple select or subselect statemet that will duplicate a record from within a table.

I tried some thing like this
insert into howto select * from howto where howto_id=31;

I think I am running into a problem because the howto_id is my primary key. Is there someway of doing this, simple.

I could do it with PHP by calling that record and storing the variables and then inserting without the howto_id, but that seems expensive. Seems like there should be a simple sql statement to accomplish copying a record within your table.
 
Back
Top