I am moving data from a MSSQL database to a MySQL database. I need to connect with PHP to MSSQL and then insert into MySQL. Could someone tell me how to:
- See if the mssql server is running remotely,
- How to connect to it?
Code:
mssql_connect($host,$user,$pass) or die('Failed Server Connect! ' . mssql_get_last_message());
mssql_select_db($dbnm) or die('Failed DB Select!');
Note: The webserver and db are on separate machines but mysql and mssql are are the same db machine.
I change to:
$dsnn = "Driver={SQL Server};Server={$host};Database={$dbnm}";
// Connect to the data source and get a handle for that connection.
$conn=odbc_connect($dsnn,$user,$pass);
I successfully figured out the Source issue and could not find db issue but now getting: I now have a message saying: Login failed for user "xxx".
Figured it out. Was told the wrong password. Reset and now works.