Page 1 of 1

SQL question

Posted: Tue Feb 13, 2007 7:23 am
by speedy33417
I'd like to move the content of one table in my database to another. The other database is already set up however the domain is still being transferred. Because I don't have dedicated IP I can't use php code rewrite the table.
However I wrote php code at the old host to echo SQL command to fill up the table.

Something like this:

Code: Select all

INSERT INTO table (blah, blah2, blah3)
VALUES ('1', '1', '2007-01-02 09:00:00')

INSERT INTO table (blah, blah2, blah3)
VALUES ('2', '2', '2007-01-03 09:00:00')

....
The problem is I wanted copy and paste the commands into SQL (phpMyAdmin), but it will only take them one at a time.
Obviously I'd rather avoid doing it that way.

How is it possible to do it in SQL?

Thanks.

Posted: Tue Feb 13, 2007 7:57 am
by onion2k
phpMyAdmin has an option to export an entire database as a SQL dump (it's cunning hidden under the "Export" tab). Then you can use phpMyAdmin on the new server to load the dump using the "SQL" tab. There's an option at the bottom to upload a SQL script file (which is just a text file full of SQL statements).