Jeff, Can you let MySQL do the work for you, with INSERT ... SELECT? Here's the URL" http://www.mysql.com/doc/I/N/INSERT_SELECT.html
HTH - Miles Thompson At 06:20 PM 1/20/2002 -0500, Jeff Lewis wrote: >I am trying to basically copy data from one database to another and am >wondering if it is possible to have more than one database open at a time. >So for example, I want to do something like this but am wondering if there >is a better way: > >$dbcon = mysql_connect($db_server, $db_user, $db_passwd); //Make source >connection >mysql_select_db($db_name); >//Select source db >$source_result = mysql_query("SELECT * FROM users"); //Select all >info from users table >while ($row_cat = mysql_fetch_array($result)){ >//Loop through and insert into new db > //Insert into new database >} > >So where I have "Insert into new database" this is where I want to take some >of the information from the source and insert into the new database (which >uses a different user name and password as well). > >Any help would be greatly appreciated :) > >Jeff > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]