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

Recommended Answers

All 6 Replies

What language are you using?

php/mysql

Are you using link identifier with mysql_query()?

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..

$link=mysql_connect("localhost", "name", "password", true);
$link1=mysql_connect("localhost", "name", "password", true);

$mysql_query($qry,$link);
$mysql_query($qry1,$link1);

This the one.

In mysql how can I connect two databases..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.