|
|
![]() |
|
|
Top | #1 |
|
OSNN Junior Addict
Joined: January 2004
Posts: 6
Reputation: 0
Power: 81 |
...possible with php?
|
|
|
|
|
|
|
|
|
Top | #2 |
|
OSNN Veteran Addict
Joined: March 2002
Location: The Netherlands
Posts: 2,647
Reputation: 270
Power: 132 |
Yep.
Code:
$connection_one = mysql_connect("server1","user","pass");
$connection_two = mysql_connect("server2","user,"pass");
mysql_select_db("db1",$connection_one);
mysql_select_db("db2",$connection_two);
mysql_query("SELECT * FROM bla1",$connection_one);
mysql_query("SELECT * FROM bla2",$connection_two);
mysql_close($connection_one);
mysql_close($connection_two);
|
|
|
|
|
|
Top | #3 |
|
We did not deserve this !
Joined: December 2001
Location: Amongst the Native Ones
Posts: 1,259
Reputation: 330
Power: 122 |
Should work fine as it seems so logical !
|
|
|
|
|
|
|
|
|
Top | #4 |
|
OSNN Junior Addict
Joined: January 2004
Posts: 6
Reputation: 0
Power: 81 |
ok I'll give it a shot, I am pretty sure I have tried this in the past, but I might have done something wrong then
![]() I'll edit this post if it works or not... |
|
|
|
|
|
|
|
|
Top | #5 |
|
OSNN Veteran Addict
Joined: March 2002
Location: The Netherlands
Posts: 2,647
Reputation: 270
Power: 132 |
*waits* I am curious myself, I might need it too in the future.
|
|
|
|
|
|
Top | #6 |
|
OSNN Junior Addict
Joined: January 2004
Posts: 6
Reputation: 0
Power: 81 |
yep it works. here is the connect code I used with passwords etc removed
![]() PHP Code:
|
|
|
|
|
|
|
|
|
Top | #7 |
|
OSNN Junior Addict
Joined: January 2004
Posts: 6
Reputation: 0
Power: 81 |
sorry took so long to reply.
anyway, you can do it by connecting to the database you want to execute the query on before the query is executed. That's the only way ive been able to get it to work correctly $db_one_connection $query_one $db_two_connection $query_two etc |
|
|
|
|
|
|
|
|
Top | #8 |
|
*
Joined: December 2001
Location: USA
Posts: 6,453
Reputation: 2738
Power: 198 |
mysql_db_select, it allows you to specify a DB connection to use.
|
|
|
|
|
|
|
|
|
Top | #9 |
|
OSNN Junior Addict
Joined: June 2005
Posts: 3
Reputation: 0
Power: 0 |
I have a question can these 2 database be join together? www.ezfilehosting.com/forum
and www.ezfilehosting.com/a I would like to know if I cna connect and how can I connect them? I try wat you guys posted above and I cannot get it to work
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can 2 databases work in same tower? | Heeter | Windows Server Systems | 2 | July 26th, 2006 12:16am |
| opening access databases | kevinfrey | Windows Desktop Systems | 1 | November 15th, 2002 12:35am |
| Merging Databases in Access | UofEEE | Windows Desktop Systems | 1 | July 24th, 2002 5:07pm |
| connecting PC to TV | ZAnwar | Graphics Cards | 17 | July 2nd, 2002 5:25am |
| VPN not connecting | Alliedsvcs | Windows Desktop Systems | 2 | February 15th, 2002 6:52pm |