Forum Moderators: coopster
I should start by saying that I have this working on one server, but I'm trying to migrate the php pages to a new server. I have uncommented the php.ini line for the mssql extension. I've restarted the services, and run up phpinfo, which doesn't say anything about mssql?
I've tried copying the php_mssql.dll to winnt/system32 just in case, no joy :(
jatar_k replied with some info about ntwdblib.dll. I tried copying that from the server on which it's working to the WINNT/system32 directory on which it isn't working, but that's not changed anything, (although I haven't rebooted, would that be the difference?)
Anyone got any other thoughts on what I should try?
Thanks
From: [php.net...]
Applies to : IIS 5.0, PHP 4.3.4, MS-SQL 2000If you try to connect to a host with multiple SQL-Server instances, you have to copy the ntwdblib.dll from a MS SQL 2000 installation to the system32 directory of your webserver.
The ntwdblib.dll bundled with php 4.3.4 does not support multpiple server instance.
I used the DLL version 2000.80.194.0 that came with MS SQL Server 8.00.194.
Example:
$dbhost="server_name\instance_name,port_number";
$dbuser="foo";
$dbpass="foo";
$dbname="foo";
$db=mssql_connect($dbhost,$dbuser,$dbpass);
mssql_select_db($dbname,$db);
Ok, so I tried rebooting, still have the same problem. I then looked a bit harder at the post from the php.net site, and noticed that they put:
$dbhost="server_name\instance_name,port_number";
I've simply been putting the server_name. Now, at the risk of looking like a complete idiot, what is the instance_name and how do I find it out, that and the port number. That said, it still doesn't explain the fact that mssql_connect is an unknown function... does it?
-----------------------------------------
$host = "my.server.ip.address";
$user = "foo";
$pass = "foo";
$dsn1 = "my_database";
$admit = mssql_connect($host,$user,$pass) or die("Could not connect to database: ".mssql_get_last_message());
-----------------------------------------
It now tells me that it cannot connect to server.
Timotheos, you said you had a hard time making this work, so what did you do to get it to connect? Or anyone else who's got this working :)
Thanks all