-
php - mssql 2005
Hi, i using mssql 2005 and am having big problems with php connect to mssql server.
When i wrote sample script like that:
PHP Code:
<?php
mssql_connect("localhost", "id", "pw") or die('error');
?>
Then i get next error:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: localhost in C:\www\reg\test.php on line 3
Could not select the database1
I tried almost evrything ... creater a lot logins allowed remote connections but nothinh help. Btw php is running on the same server as mssql 2005.
Thanks for help.
-
Re: php - mssql 2005
try take out "or die('error')"
-
Re: php - mssql 2005
then i get just:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: localhost in C:\www\reg\test.php on line 3
-
Re: php - mssql 2005
Nobody know what else can be wrong?
-
Re: php - mssql 2005
-
Re: php - mssql 2005
if (ALLOW_OPEN != 1){
exit("<strong>Error: </strong>Leave NuB ;]");
}
$connect = mssql_connect("localhost","ID","PW");
-
Re: php - mssql 2005
try this with selecting database because you said it gives error "Could not select the database1", either connect to kal_auth or kal_db.
PHP Code:
$msconnect = mssql_connect("localhost", "user", "pass");
$msdb = mssql_select_db("kal_auth", $msconnect);
If this doesnt work you can try to connect without user/pass;
PHP Code:
$msconnect = mssql_connect("localhost");
$msdb = mssql_select_db("kal_auth", $msconnect);
-
Re: php - mssql 2005