Guest User

Untitled

a guest
Mar 9th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. $server = 'xxx.xxx.xxx.xxx';
  2. $user = 'user.....';
  3. $pass = 'password...';
  4.  
  5. $port='1433';
  6. $database = 'database...';
  7.  
  8. $connection_string = "DRIVER={SQL Server};SERVER=$server;PORT=$port;DATABASE=$database";
  9. $conn = odbc_connect($connection_string,$user,$pass);
  10. if ($conn) {
  11. echo "Connection established.";
  12. } else{
  13. die("Connection could not be established.");
  14. }
Add Comment
Please, Sign In to add comment