Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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

Posts: 303
Trades: 0
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
 
 
Register now for full access!
Old 07-05-2004, 08:33 AM dual connections
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.45762 seconds with 12 queries