#3 is the easiest...
from command line:
# mysqldump -uroot db_from > db.sql
# mysql -uroot db_to < db.sql
Now, the entire database was copied.
This is the easiest way for the whole database. With single table it is
quite similar.
Also if the table in db_to already exists, then it might make more sense a
loop in PHP to reinsert the staff under your own conditions.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: Joe Stump [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 10:48 AM
To: Augusto Cesar Castoldi
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] MySQL data
There are a few ways to do this...
1.) Copy the binary files over in the mysql data directory ... have to be
root
and normally at a shell.
2.) SELECT * FROM table and then while() you have rows INSERT INTO
other_table
those values
3.) mysqldump can be used via PHP and used by most users ...
hope this helps ...
--Joe
On Tue, Apr 17, 2001 at 09:05:02PM -0300, Augusto Cesar Castoldi wrote:
> This question has not much with PHP, but I work with PHP...
>
> Can I get the data from a table in MySQL and copy/transfer all data to
> other database to a table with the same name?
>
> regards,
>
> Augusto Cesar Castoldi
>
>
> --
> 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]
/* Joe Stump
* Sr. PHP Developer
* http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
*/
--
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]