INSERT INTO `dbname`.`newtablename`
SELECT *
FROM `dname`.`oldtablename` ;
bastien
From: blackwater dev <blackwaterdev@xxxxxxxxx>
Reply-To: blackwater dev <blackwaterdev@xxxxxxxxx>
To: php-db@xxxxxxxxxxxxx
Subject: select particular columns in query
Date: Wed, 8 Dec 2004 10:46:44 -0500
Hello,
I want to create a new row in the db by copying an existing one. My
db has an auto incrementing id so I can't simply do insert into cars
select * from cars where id=$id as this throws the primary key error.
How can I do this with out specifying each column?
Thanks!
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php