使用PHP连接两个不同的数据库服务器 [英] Connect two different database server using PHP

查看:116
本文介绍了使用PHP连接两个不同的数据库服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想用php / mysql连接两个不同的数据库服务器。

假设我有一些数据 www.xyz.com 我想在 www.abc.com

我如何整合两个不同的数据库服务器请一些机构告诉我...


提前谢谢

解决方案

您知道如何连接到一个数据库吗?如果没有在线查看PHP教程并在php.org上阅读手册


我甚至不知道你正在使用什么数据库,如果MySQL然后php有本机函数那。


如果您知道如何连接到一个,那么您可以连接到多个。




Dan


当然我知道如何连接一个数据库,但我面对的是问题,如果我在本地服务器上连接两个不同的数据库,它工作fike和当我上传该文件到远程服务器它不工作,我使用PHP 5.0 / MYSQL。


使用一个远程服务器通常需要访问权限(许多ISP服务器只允许本地主机访问)。否则你需要确保始终传递正确的资源链接。 (如果你使用的是 PDO ,你可能会得到2个DB对象) / BLOCKQUOTE>

Hi everyone,

I want to connect two different database server using php/mysql.
Suppose i have some dat on www.xyz.com and i want to select that data on www.abc.com
How do i integrate two different database server please some body tell me...

Thanks in advance

解决方案

do you know how to connect to one database? if not look online for PHP tutorial and read the manual at php.org

I don''t even know what database you''re using, if MySQL then php has native functions for that.

If you know how to connect to one, then you can connect to multiple.




Dan


of course i know how to connect one database but i am facing the problem like if i connect two different databse on local server it works fike and when i upload that file to remote server its not working and i am using PHP 5.0/MYSQL .


to work with a remote server you usually need permissions to access it (many ISP servers allow only localhost access). otherwise you need to make sure to always pass the correct resource link. (if you''re using PDO you might get away with 2 DB objects, though)


这篇关于使用PHP连接两个不同的数据库服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆