connecting to multiple databases

wxdqz

New Member
I haven't found this one yet in the forums or in my books, but am sure others have asked...I need to connect to multiple databases on different servers as I run my SQL queries to fetch data and construct the HTML that gets inserted further down the page. I've tried connect and pconnect and tried closing and not closing my respective connections, but am not having any luck. It seems that the last database to be connected to is the only one where the results are returned and everything works.

This is the connect statement that I'm using:
mssql_connect('server.domain.com', 'User', '') or die("<p CLASS=content1>Failed to connect to the database.");

mssql_select_db('Database') or die("<p CLASS=content1>Failed to find the database.");

The environment is:
Server 1 - Apache 1.3.19 and PHP 4, Win2000Pro and MS-SQL2000

Server 2 - OS? and MS-SQL7

Any suggestions would be appreciated...thanks,

Adam.
 
Back
Top