Results 1 to 4 of 4

Thread: copying tables

  1. #1
    Join Date
    Mar 2004
    Posts
    4

    Unanswered: 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?

  2. #2
    Join Date
    Jan 2004
    Posts
    24
    The lazy way is by just using a tool like PHPMyAdmin.

    Donny
    http://www.phpscripts.com/

  3. #3
    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?

  4. #4
    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;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •