Moving row to new table with wildcards

I need to move a row from one table to another table that shares the same structure. Is there a way to do that with wildcards?

I thought something like this might work, but no go.

mysql_query("INSERT INTO trkg_arc (*) SELECT * FROM trkg WHERE id = 3") or die(mysql_error());

Maybe lose the (*) on INSERT:


INSERT INTO trkg_arc SELECT * FROM trkg WHERE id = 3

Thanks itmitică. That worked.

:slight_smile:

“Captain, the most elementary and valuable statement in science, the beginning of wisdom, is ‘I do not know.’” - Lt. Commander Data, Star Trek TNG

It is better programming practice to both name the columns from the table being inserted and the table being selected. For example, let’s imagine you add a new column to one table. Your code would all of a sudden stop working. Likewise if you rebuild your table and reorder the columns then you will get very strange results.