Jump to content

Database connection to more than 1 database at a time


jwwceo

Recommended Posts

Hello all,

I have 4 businesses online right now. They each use a custom shopping cart designed to the needs of that specific site. They each have their own database associated with the site.

I would like to make a master corporate page that simply pulls stats and displays them on a big executive dashboard.

Can I connect to more than 1 database at a time??? how do I do this. how is the syntax for a particular table noted?

thanks in advance.

James
might be an awfully complex code considering that they may all be on different servers and such.  Your best bet might be to have each site create it's own page of date and then use an application like curl or something to pull all data from each server/site.  For example each site could create a CSV file or something like that and then use curl on the "master page" to pull in all said data.  Sound good?
[code]
$cn1=@mysql_connect("host","username","password");
$cn2=@mysql_connect("host","username","password");
$cn3=@mysql_connect("host","username","password");
$cn4=@mysql_connect("host","username","password");

$result1=@mysql_query("query",$cn1);
$result2=@mysql_query("query",$cn2);
etc...
[/code]

Archived

This topic is now archived and is closed to further replies.

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