Welcome Guest, Not a member yet? Register   Sign In
MSSQL Connection
#1

[eluser]shankar ganesh[/eluser]
I have to connect MSSQL using php5, but it says errors as below. I tried restarting my IIS, User and password is exists and its correct. But i don't know how to connect it.


Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: ANGLER66 in /home/jumpwebservice/public_html/test.php on line 8
#2

[eluser]tonanbarbarian[/eluser]
what are the connection details you are using?
is it possible that the hostname you are using for the server is not resolving correctly?
#3

[eluser]shankar ganesh[/eluser]
These are code i used for connection

Code:
<?php
$myServer = "ANGLER43\SQLEXPRESS";
$myUser = "sa";
$myPass = "";
$myDB = "cms";

//connection to the database
if($link = mssql_connect($myServer, $myUser, $myPass))
{
    if(mssql_select_db($myDB, $link))
    {
        echo "Database found";
    }
    else
    {
        echo "Database not selected";
    }
}
else
{
    echo 'Not Connected';
}

?>
#4

[eluser]cool248[/eluser]
try changing the myserver to the local ip address number (127.0.0.1) or with current ip address in your pc.




Theme © iAndrew 2016 - Forum software by © MyBB