Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- copy field from one table to another
November 26, 2007, 2:34 pm
rate this thread
i am trying to copy a completed field set from one table to another.
I am using this SQL command:
INSERT INTO doc_valid SELECT * from doc_temp where id=$id
it works, but it also copy the index field id from my temp table to the
the index are autoincrement primary key, and it should take the next index
How can i make this copy and use the auto incremental index of the
- Kim AndrÃ© AkerÃ¸
November 26, 2007, 2:56 pm
Re: copy field from one table to another
Although this question has more to do with MySQL than PHP, and should
rather have been posed in comp.databases.mysql, you might try
specifying the field names you want to extract from the temp table
instead of * (which means ALL fields, including the "id" field).
Kim André Akerø
(remove NOSPAM to contact me directly)