RE: [PHP] Duplicating a Record in MySQL

From: Date: Sat, 19 Oct 2002 19:33:23 +0000
Subject: RE: [PHP] Duplicating a Record in MySQL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-120620@lists.php.net to get a copy of this message
>> It's not strictly php, but does anyone know an easy way to duplicate a >> record in MySQL. It would be nice if you could write something like: >> >> COPY * from table WHERE id = 6; >> >> and have it insert a new record into the table with the next id >>number. >I think that if you have to do this, you've got design issues. Why not >just keep a "count" column in the row and increment that, instead of >duplicating the row. >---John Holmes... John, Here's the application: I'm creating a daily report online, eg. with Title, Report no., Date, Author, Subject Headings, Text, etc., etc.. The report is stored in a MySQL table. When it comes time to write a new report, I would like to be able to call up an existing report, upon which to base the new one, and copy the record. Then make changes where necessary and update the record. Roger

« previous php.general (#120620) next »