asmith Posted January 5, 2008 Share Posted January 5, 2008 create table database2.table2 like database1.table1 insert into database2.table2 select * from database1.table1 i found this over the net to copying a table from one data base to another , is it the shortest way ? can i do it with only one line ? Quote Link to comment https://forums.phpfreaks.com/topic/84582-solved-copy-a-table/ Share on other sites More sharing options...
Barand Posted January 5, 2008 Share Posted January 5, 2008 If you don't need the indexes and just want to copy the data create table database2.table2 select * from database1.table1 Quote Link to comment https://forums.phpfreaks.com/topic/84582-solved-copy-a-table/#findComment-431076 Share on other sites More sharing options...
asmith Posted January 5, 2008 Author Share Posted January 5, 2008 no , i'm just testing a table with values, so after a while i just want to reset it to the previous values it had. so i want to make a copy of it somewhere and ... thanks so much for the code ! solved ! Quote Link to comment https://forums.phpfreaks.com/topic/84582-solved-copy-a-table/#findComment-431088 Share on other sites More sharing options...
fenway Posted January 5, 2008 Share Posted January 5, 2008 If you don't need the indexes and just want to copy the data create table database2.table2 select * from database1.table1 Did this always work? I don't know that I've ever seen it. Quote Link to comment https://forums.phpfreaks.com/topic/84582-solved-copy-a-table/#findComment-431158 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.