943,793 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 5573
  • MySQL RSS
Mar 19th, 2009
0

How to connect to two databases at the same time

Expand Post »
Hello Guys I want to connect two databases at the same time but it looks like the php is only picking up the second database.

One database is on my localhost and the other one is on server, I want to transfer the data from my localhost database to the database on the server. I have also tried passing the 4th argument to the mysql_connect function but I can't get it to work.
mysql_connect("localhost", "name", "password", true);

Please help me.

Thanks
Similar Threads
Reputation Points: 40
Solved Threads: 7
Junior Poster
architact is offline Offline
114 posts
since Apr 2008
Mar 19th, 2009
0

Re: How to connect to two databases at the same time

What language are you using?
Reputation Points: 17
Solved Threads: 3
Junior Poster
PirateTUX is offline Offline
101 posts
since Jan 2007
Mar 19th, 2009
0

Re: How to connect to two databases at the same time

php/mysql
Reputation Points: 40
Solved Threads: 7
Junior Poster
architact is offline Offline
114 posts
since Apr 2008
Mar 19th, 2009
0

Re: How to connect to two databases at the same time

Are you using link identifier with mysql_query()?
Reputation Points: 29
Solved Threads: 47
Posting Whiz
mwasif is offline Offline
312 posts
since Dec 2007
Mar 19th, 2009
0

Re: How to connect to two databases at the same time

http://in.php.net/mysql_select_db Read the comments, especially of buzz at oska dot com
Moderator
Featured Poster
Reputation Points: 524
Solved Threads: 356
Purple hazed!
nav33n is offline Offline
3,878 posts
since Nov 2007
Jul 24th, 2009
1

Re: How to connect to two databases at the same time

Click to Expand / Collapse  Quote originally posted by architact ...
Hello Guys I want to connect two databases at the same time but it looks like the php is only picking up the second database.

One database is on my localhost and the other one is on server, I want to transfer the data from my localhost database to the database on the server. I have also tried passing the 4th argument to the mysql_connect function but I can't get it to work.
mysql_connect("localhost", "name", "password", true);

Please help me.

Thanks
This help you out..
php Syntax (Toggle Plain Text)
  1. $link=mysql_connect("localhost", "name", "password", true);
  2. $link1=mysql_connect("localhost", "name", "password", true);
  3.  
  4. $mysql_query($qry,$link);
  5. $mysql_query($qry1,$link1);
This the one.
Last edited by peter_budo; Jul 24th, 2009 at 3:03 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
abhi211285 is offline Offline
4 posts
since Apr 2009
Nov 25th, 2011
0

man

In mysql how can I connect two databases..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vamsy143 is offline Offline
1 posts
since Nov 2011
Message:
Previous Thread in MySQL Forum Timeline: Export MySQL to SQLite
Next Thread in MySQL Forum Timeline: date = curdate





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC