Bug #13738: cant connect to external db with dns name
| From: | sliljedahl at ad-c dot com | Date: | Thu, 18 Oct 2001 14:56:14 +0000 |
| Subject: | Bug #13738: cant connect to external db with dns name | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-68238@lists.php.net to get a copy of this message | ||
From: sliljedahl@ad-c.com
Operating system: Win 2000 server
PHP version: 4.0.6
PHP Bug Type: MSSQL related
Bug description: cant connect to external db with dns name
I am running php 4.0.6 on IIS 5 on a windows 2000 server
My database runs ms sql 2000 on a windows 2000 server seperate machine from
the web server.
my dns is set so that my database machine is named labdb and its ip address
in 192.168.0.63
when I execute
function ConnectToDatabase()
{
$dbname = "is5sql";
$dbserver = "labdb";
if(!mssql_connect($dbserver, "interscale", "")){
return FALSE;
}
if(!mssql_select_db($dbname)){
return FALSE;
}
return TRUE;
}
I get an error that I cannot connect to the database.
when i execute:
function ConnectToDatabase()
{
$dbname = "is5sql";
$dbserver = "192.168.0.63";
if(!mssql_connect($dbserver, "interscale", "")){
return FALSE;
}
if(!mssql_select_db($dbname)){
return FALSE;
}
return TRUE;
}
this connects to the database and returns true.
I can connect to the database server with the dns name if i use ADO, but
not if i use the php_mssql.dll.
can this be fixed?
--
Edit bug report at: http://bugs.php.net/?id=13738&edit=1