If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > copying tables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-05-04, 18:51
darudude darudude is offline
Registered User
 
Join Date: Mar 2004
Posts: 4
copying tables

hi i want to be able to copy all the fields and values in a table in one databse to a table in another database. is there any way this can be done?
Reply With Quote
  #2 (permalink)  
Old 03-05-04, 23:30
donsimon donsimon is offline
Registered User
 
Join Date: Jan 2004
Posts: 24
The lazy way is by just using a tool like PHPMyAdmin.

Donny
__________________
http://www.phpscripts.com/
Reply With Quote
  #3 (permalink)  
Old 03-06-04, 12:36
darudude darudude is offline
Registered User
 
Join Date: Mar 2004
Posts: 4
yeah i know it can be done with phpadmin but i want to do it with sql. any statements i can use for this?
Reply With Quote
  #4 (permalink)  
Old 03-06-04, 18:27
vanekl vanekl is offline
Registered User
 
Join Date: Nov 2003
Posts: 91
IF the databases are on the same machine,

create table newdb.newtable select * from olddb.oldtable;

Or, if the new tables have already been created,

insert into newdb.newtable select * from olddb.oldtable;
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On