Kurt111780
Technical User
Hello, I am new to php and SQL Server. I am having trouble getting php connected to SQL Server.
What i did:
Installed PHP 4.2 using installer for IIS
Installed SQL Server Express on same server
copied the php_mssql.dll to php folder
copied ntwdblib.dll to System32 folder
uncommented php_mssql.dll in the php.ini file
Warning: mssql_connect(): Unable to connect to server: localhost in D:\ on line 18
Unable to connect to server
What could I be doing wrong?
Thanks,
Kurt
It's only easy when you know how.
What i did:
Installed PHP 4.2 using installer for IIS
Installed SQL Server Express on same server
copied the php_mssql.dll to php folder
copied ntwdblib.dll to System32 folder
uncommented php_mssql.dll in the php.ini file
Warning: mssql_connect(): Unable to connect to server: localhost in D:\ on line 18
Unable to connect to server
Code:
$db = mssql_connect("localhost","username","password") or die("Unable to connect to server");
mssql_select_db("myDatabase");
$result = mssql_query("SELECT * FROM myTable");
What could I be doing wrong?
Thanks,
Kurt
It's only easy when you know how.