title: php mssql_connect: failed
body: <p>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:</p>
  
  <ul>
  <li>See if the mssql server is running remotely, </li>
  <li>How to connect to it?</li>
  </ul>
  
  <p>Code:</p>
  
  <pre><code>mssql_connect($host,$user,$pass) or die('Failed Server Connect! ' . mssql_get_last_message());
  mssql_select_db($dbnm) or die('Failed DB Select!');
  </code></pre>
  
  <p>Note: The webserver and db are on separate machines but mysql and mssql are are the same db machine.</p>
  
  <p>I change to:
  <code>$dsnn = "Driver={SQL Server};Server={$host};Database={$dbnm}";</code></p>
  
  <pre><code>// Connect to the data source and get a handle for that connection.
  $conn=odbc_connect($dsnn,$user,$pass);
  </code></pre>
  
  <p>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".</p>
  
  <p><strong>Figured it out. Was told the wrong password. Reset and now works.</strong></p>