Re: select particular columns in query
| From: | Doug Thompson | Date: | Wed, 08 Dec 2004 16:17:11 +0000 |
| Subject: | Re: select particular columns in query | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37645@lists.php.net to get a copy of this message | ||
The manual is your friend.
You cannot execute the SQL statement you provided because mysql specifically disallows it:
http://dev.mysql.com/doc/mysql/en/INSERT_SELECT.html
Same reference, your presumption about auto-increment columns is also wrong.
Doug
blackwater dev wrote:
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!