Hi,
How to connect to two databases simultaneously from 2 different server?
E.g.
I have established a connection to db1, while on 'while loop' a certain field needs to access data from db2 from different server. How this would be implemented, using MySQL and PHP?
Stringx
How to connect to two databases simultaneously from 2 different server?
|
Newbie Member
|
|
| 16Feb2011,13:12 | #1 |
|
Go4Expert Member
|
|
| 19Feb2011,12:13 | #2 |
|
i never tried but i am sure u can do by using two connection files
|
|
Skilled contributor
|
![]() |
| 25Feb2011,20:10 | #3 |
|
its easy i think
you should make two db handlers PHP Code:
and dont use the MAKE connection thing inside a loop unless it will make multiple connections if you have no option, use mysql_pconenct but if you put your code, i can tell you better
|
|
Ambitious contributor
|
|
| 9Mar2011,03:24 | #4 |
|
if your trying to query one database using fields from another you could but you'd need to know the fields before hand. Return the first database result as an associative array and us that in your second query. If you return both as the same array it should add the data together.
PHP Code:
|
|
Light Poster
|
|
| 24Mar2011,07:02 | #5 |
|
yes,it's not hard,I figured it out when I try to integrate wiki with phpbb,there is a ready-made wiki plugin do that to verify phpbb users
|

