[eluser]FutureKing[/eluser]
When I try to connect to MSSQL Server I am getting following message :
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: GEEK-PC\SQLSERVER in G:\websites\localhost\test.php on line 7
But if I run the same script via command line I get this message:
Fatel Error: Call to undefined function mssql_connect() in .....
two different messages for same script? Why am I not able to connect to sql server.
SQL Server Version: 2005
OS : Windows
Server WAMP Server
PHP 5.2
Code:
Code:
$server = 'GEEK-PC\SQLSERVER';
$link = mssql_connect($server, 'username', 'password');
if (!$link) {
die('Something went wrong while connecting to MSSQL');
}else{
echo "connected";
}
phpinfo is showing that MSSQL extension for php is active.