|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Connecting to multiple db's across multiple sites
Is there a way to connect to multiple databases across multiple sites?
Example: SiteA.com has database 'SiteADB' and SiteB.com has database 'SiteBDB'. Someone logs in to site A to add info to 'SiteADB'. Can I connect to 'SiteBDB' so that the information being added to 'SiteADB' will also be added to 'SiteBDB'? Thanks for any help. |
|
#2
|
|||
|
|||
|
It should be possible...not that I have a clear solution from the top of my head. But on the other hand it might not be since to my relatively low knowledge you need to have some connection between your website and your database..
However, // DB connection 1 $con = mysql_pconnect("localhost", "databaseLogin1", "password1") or die(mysql_error()); mysql_select_db("databaseName1") or die(mysql_error()); // DB connection 2 $con = mysql_pconnect("localhost", "databaseLogin2", "password2") or die(mysql_error()); mysql_select_db("databaseName2") or die(mysql_error()); If you would like to connect to several databases it should be possible, just connect to them via different connection strings.... |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > Connecting to multiple db's across multiple sites |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|