jwwceo Posted October 31, 2006 Share Posted October 31, 2006 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 Link to comment https://forums.phpfreaks.com/topic/25664-database-connection-to-more-than-1-database-at-a-time/ Share on other sites More sharing options...
cunoodle2 Posted October 31, 2006 Share Posted October 31, 2006 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? Link to comment https://forums.phpfreaks.com/topic/25664-database-connection-to-more-than-1-database-at-a-time/#findComment-117144 Share on other sites More sharing options...
fert Posted October 31, 2006 Share Posted October 31, 2006 [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] Link to comment https://forums.phpfreaks.com/topic/25664-database-connection-to-more-than-1-database-at-a-time/#findComment-117148 Share on other sites More sharing options...
jwwceo Posted October 31, 2006 Author Share Posted October 31, 2006 thanks. that's what I was looking for...it looks like you just have to specify which connection to use for each query.seems easy enough... I'll give it a try... Link to comment https://forums.phpfreaks.com/topic/25664-database-connection-to-more-than-1-database-at-a-time/#findComment-117156 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.