Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Mar 9th, 2013  |  syntax: None  |  size: 0.85 KB  |  hits: 34  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. $objConnect = mssql_connect("localhost","usr","pass");
  3.  
  4. if($objConnect)  
  5. {  
  6.   echo "Database Connected.<br />";  
  7.   echo mssql_error();
  8. }  
  9. else  
  10. {  
  11.   echo "Database Connect Failed.<br />";
  12. }  
  13.  
  14. mssql_close($objConnect);  
  15. ?>
  16.        
  17. $objConnect = mssql_connect("localhostSQLEXPRESS","usr","pass");
  18.        
  19. $objConnect = mssql_connect("localhostInstanceName","usr","pass");
  20.        
  21. $objConnect = mssql_connect("192.168.5.22SQLEXPRESS","usr","pass");
  22. $objConnect = mssql_connect("192.168.5.22NamedInstance","usr","pass");
  23. $objConnect = mssql_connect("192.168.5.22","usr","pass");
  24.        
  25. if($objConnect)  
  26. {  
  27.   echo "Database Connected.<br />";  
  28.   echo mssql_error();
  29. }  
  30. else  
  31. {  
  32.   echo "Database Connect Failed.<br />";  
  33. }
  34.        
  35. if($objConnect)  
  36. {
  37.   echo "Database Connected.<br />";  
  38. }  
  39. else  
  40. {  
  41.   echo "Database Connect Failed.<br />";  
  42.   echo mssql_error();
  43. }