Reply
Connecting to multiple databases
Old 07-05-2004, 07:15 AM Connecting to multiple databases
lothop's Avatar
Extreme Talker

Posts: 226
Is there a way to connect to two different databases and store the same information in both.

For example.
The person signs up for membership of the site, whilst at the same time automatically signing up for the forum.

I know this would depend on what tables and fields that are needed to have information sent to, but I'm just wondering if it was even possible. Because it would be cool. A lot easier and less trouble for the person signing up to have to do both.

Thanks,
Lothop
lothop is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 07-05-2004, 07:33 AM dual connections
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
You should be able to create two seperate connections.

$con = mysql_connect(DB1, etc, etc);
$con1 = mysql_connect(DB2, etc, etc);

The sql you create can be used on both handles (con1 & con2)
I.E
mysql_query (QSTRING, handle);

so as long as you pass the handle you should be working under that handles DB.

so to do it on both just call mysql_query twice each with a seperate handle to connect to the seperate DB.


Ibbo
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Reply     « Reply to Connecting to multiple databases
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11332 seconds with 13 queries