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 ? 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 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 ! 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. Link to comment https://forums.phpfreaks.com/topic/84582-solved-copy-a-table/#findComment-431158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.