mohamedismail — 2013-10-01T07:06:14-04:00 — #1
How can I retrieve values from one database server and store them in other database server using PHP?
cpradio — 2013-10-01T07:31:57-04:00 — #2
First off, please provide useful thread titles instead of meaningless ones, like "PHP Thread". That means nothing, and it won't get any interest for others to help you.
Now with that said, you would simply connect to database server A, query your data, connect to database server B, and insert your data. But all that is useless, when you can simply perform a mysqldump from database server A and import it into database server B.
jburns131 — 2013-10-02T11:04:25-04:00 — #3
What @cpradio; said is correct.
Easiest way is to do a mysqldump, or do an 'Export' from phpmyadmin if that's available.
You can also fetch from one database and insert into another.
If you plan on doing this often, you might want to google for "php database migration" and "php database synchronization". There are a few stand alone migration tools, and there are some powerful tools that include migration functionality.
Here are some links:
Yii Tool: http://www.yiiframework.com/doc/guide/1.1/en/database.migration
Propel (has built in migrations): http://propelorm.org/
Doctrine (can add migrations): http://www.doctrine-project.org/projects/migrations.html
Hope this get's you pointed in the right direction