SQL question

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
speedy33417
Forum Contributor
Posts: 128
Joined: Sun Jul 23, 2006 1:14 pm

SQL question

Post 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.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post 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).
Post Reply