|
|
![]() |
|
|
Top | #1 |
|
OSNN Junior Addict
Joined: January 2004
Posts: 6
Reputation: 0
Power: 99 |
|
|
|
|
|
|
Top | #2 |
|
OSNN Veteran Addict
Joined: March 2002
Location: The Netherlands
Posts: 2,626
Reputation: 270
Power: 150 |
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,243
Reputation: 330
Power: 139 |
Should work fine as it seems so logical !
|
|
|
|
|
|
Top | #4 |
|
OSNN Junior Addict
Joined: January 2004
Posts: 6
Reputation: 0
Power: 99 |
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,626
Reputation: 270
Power: 150 |
*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: 99 |
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: 99 |
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,490
Reputation: 2808
Power: 217 |
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 1:16am |
| opening access databases | kevinfrey | Windows Desktop Systems | 1 | November 15th, 2002 1:35am |
| Merging Databases in Access | UofEEE | Windows Desktop Systems | 1 | July 24th, 2002 6:07pm |
| connecting PC to TV | ZAnwar | Graphics Cards | 17 | July 2nd, 2002 6:25am |
| VPN not connecting | Alliedsvcs | Windows Desktop Systems | 2 | February 15th, 2002 7:52pm |