Muddy_Funster Posted March 3, 2011 Share Posted March 3, 2011 Hi all. I was looking through some old code and found some pages for a year or so back. In one of the pages there are a couple of SQL queries run from within the while loop of another query. I had to do this mainly because the first query is a SELECT query that is run against an MS SQL Server on what I will reffer to as "Host_A", and the queries run from within the while loop of this result set are running INSERTs agains a MySQL Server that I'm going to call "Host_B". Now Host_A and Host_B are two different physical servers, Host_A was WinServer 2003 and Host_B was CentOS Linux distro' (used as web front end due to the owners only having 5CAL's for the WinServer). Both are on the same network (not that I think that makes a difference). I just got to wondering - As I'm not a fan of querying within a query in this nature - Is it actualy possable to code a connection to both Host_A and Host_B simultaneously running a single query using both types of DB server? -- I assume "not at all" will be the answer, given that mssql_query() and mysql_query() are different commands. Just thought I would ask the question on the off chance that someone knows of a way (in case I ever come accross this type of scenario again...I like to prepare for the worst ) Let me know your thoughts. Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/229473-simultaneous-cross-database-connection/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 3, 2011 Share Posted March 3, 2011 The query is executed on and by the database server, so no, this is not possible as it would require the database server where the query is being executed to have the ability to connect to and access the data on the other database server. Quote Link to comment https://forums.phpfreaks.com/topic/229473-simultaneous-cross-database-connection/#findComment-1182322 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.