dapcigar Posted October 22, 2014 Share Posted October 22, 2014 I know this code works INSERT INTO archive_table SELECT * FROM original_table WHERE id = 1 But i want to also add the current date whenever i copy the data into a new table. Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/291976-copy-files-from-one-table-to-another/ Share on other sites More sharing options...
Solution jazzman1 Posted October 22, 2014 Solution Share Posted October 22, 2014 Have you tried to add now() to the selecting list of the original_table. Something like: INSERT INTO archive_table(col_1, col_2, col_3) SELECT col_1,col_2, now() FROM original_table WHERE id = 1 Quote Link to comment https://forums.phpfreaks.com/topic/291976-copy-files-from-one-table-to-another/#findComment-1494367 Share on other sites More sharing options...
dapcigar Posted October 22, 2014 Author Share Posted October 22, 2014 Yeah, that solved the issue... thanks Quote Link to comment https://forums.phpfreaks.com/topic/291976-copy-files-from-one-table-to-another/#findComment-1494370 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.