title: PHP remote access MSSQL Server
body: <p>I was trying to use php to remote connect to MSSQL database in other server. But at the end it show error</p>
  
  <pre><code>Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: xxx.xxx.xxx.xxx in xxxxxxx 
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>    &lt;?php
  $myServer = "xxx.xxx.xxx.xxx";
  $myUser = "user";
  $myPass = "password";
  $myDB = "database";
  
  //connection to the database
  $dbhandle = mssql_connect($myServer, $myUser, $myPass)
    or die("Couldn't connect to SQL Server on $myServer");
  
  //select a database to work with
  $selected = mssql_select_db($myDB, $dbhandle)
    or die("Couldn't open database $myDB");
    ?&gt;
  </code></pre>
  
  <p>I have try the login with microsoft SQL Server Management Studio and it can work and login so I don't that having problem with the allow remote connection access.</p>
  
  <p>Btw.. I just access it from XAMPP Localhost. I'm not sure is this effect or not.</p>
  
  <p>Thank you in advanced for whose help.</p>