MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 24th, 2005, 08:40 AM
CobraTi CobraTi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 8 CobraTi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 57 m 13 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old December 8th, 2005, 07:03 AM
Laban Laban is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 40 Laban User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 15 m 32 sec
Reputation Power: 4
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....

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Connecting to multiple db's across multiple sites


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT