Re: Duplicating a mySQL row

From: Date: Mon, 03 Dec 2001 20:04:02 +0000
Subject: Re: Duplicating a mySQL row
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-76411@lists.php.net to get a copy of this message
It appears that this is forbidden ... From mysql.com: The target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query because it's forbidden in ANSI SQL to SELECT from the same table into which you are inserting. (The problem is that the SELECT possibly would find records that were inserted earlier during the same run. When using sub-select clauses, the situation could easily be very confusing!)
I don't know if it is the best but here's an idea: INSERT INTO table SELECT ha, he, hi, ho, hu FROM table LIMIT 1; -- Julio Nobrega Don't eat the yellow snow. "Jim" <jim@nettmedia.com> wrote in message news:p0510100fb8318736de56@[192.168.1.17]...
What's the best way to duplicate a mysql row with PHP and MYSQL? -- Jim Musil --------- Multimedia Programmer Nettmedia ------------- 212-629-0004 jim@nettmedia.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
-- Jim Musil --------- Multimedia Programmer Nettmedia ------------- 212-629-0004 jim@nettmedia.com

« previous php.general (#76411) next »