Jump to content

Recommended Posts

Hello, I want to make one mysql query but it will be connecting to two different databases on two different servers. Is this possible?

 

Here is the query I have written, I'm just not sure how to get it to work with two db's.

 

$sql = "SELECT cdb.ca.achievement, cdb.c.name, cdb.c.race, cdb.c.class, cdb.c.gender, cdb.c.level, vb.a.name
FROM cdb.characters c, cdb.character_achievement ca, vb.achievements a
WHERE cdb.c.guid = cdb.ca.guid 
AND cdb.ca.achievement = vb.a.id
ORDER BY cdb.ca.date DESC
LIMIT 100 
;";

 

 

Any help would be very much appreciated.

Queries are specific to a connection and execute on the database server. Since you will need two separate connections/two separate database servers, you would need to execute two different queries and tie the results together in your php script or copy (replicate) the data from one server to the other and then use a single query.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.