Moving Info to Another DB

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
Jim
Forum Contributor
Posts: 238
Joined: Fri Apr 19, 2002 5:26 am
Location: Near Austin, Texas

Moving Info to Another DB

Post by Jim »

Is it possible to easily move information from one database to another?

I want to move my forums on Prodigy to another db so I can create a better registration/login script. Thanks!
User avatar
sam
Forum Contributor
Posts: 217
Joined: Thu Apr 18, 2002 11:11 pm
Location: Northern California
Contact:

Post by sam »

Here you go... A few mods to the operation at the bottom should be all you need.

http://www.evilwalrus.com/viewcode.php?codeEx=486

Code: Select all

<?
# add this to the bottom aafter the header calls (make sure you remove the rest
# make sue you have the database created.

$db = mysql_connect("localhost","root");
mysql_select_db("forum",$db);

$tables = _get_tables("over_top");
foreach($tables as $tab)&#123;
    mysql_query(_create_table($tab),$db);
    mysql_query(_dump_table($tab),$db);
&#125;
?>
Cheers Sam
Post Reply