Error
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 192.168.0.22\sqlexpress in c:\AppServ\www\sql\connect.php on line 7
เชื่อมต่อไม่ได้
Code
Warning: mssql_close(): supplied argument is not a valid MS SQL-Link resource in c:\AppServ\www\sql\connect.php on line 17
ตัวอย่างครับ
Code (PHP)
<html>
<head>
<title>connect</title>
</head>
<body>
<?
$objConnect = mssql_connect("192.168.0.22\sqlexpress","test","1234");
//$objConnect = odbc_connect("192.168.0.22\sqlexpress","test","1234") or die("Error Connect to Database");
//$objConnect = odbc_connect("testserver","test","1234") or die("Error Connect to Database");
if($objConnect)
{
echo "เชื่อมต่อได้";
}
else
{
echo "เชื่อมต่อไม่ได้";
}
mssql_close($objConnect);
?>
</body>
</html>