By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,215 Members | 1,005 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,215 IT Pros & Developers. It's quick & easy.

Connection problem with MS-SQL-server

P: n/a
Hello,

I use an Apache-Web-Server 1.3 with PHP 5 under Windows 2000. With a
PHP-script I want to get data from a MS-SQL-Server.
Therefore is within my php.ini:

extension=php_mssql.dll

Within my PHP-script the first relevant line is:

$conn=mssql_connect("mySqlServerName", "myUserID", "myPassword");
if (! $conn) Die("Error opening database: ".mssql_get_last_message());
I want to work with 2 SQL-servers.

With the first one (version unknown) the connection succeed and I can get
data.

With the other (MS-SQL-Server 2000) I get an error trying to connect to the
SQL-Server:

Warning: mssql_connect(): Unable to connect to server: mySqlServerName

The same script runs on another web-Server without any problem and can get
data from both SQL-Servers. I can also get data from both SQL-Server from
my machine using other tools (i.e. a Java-applikation). So the error must
be caused by PHP, ini-files, DLLs, ... on my machine.

With some tools I have recognized, that in case of a successful
MS-SQL-connection, the client (in my case the PHP-interpreter) opens a
socket connection on port 1433 to the SQL-server. In my case such a socket
connection is not opened.

Somebody has an idea, what I can do ?

Georg Gerber

Jul 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Joshua!
On Thu, 31 Jul 2003 17:45:31 -0400, Joshua Ghiloni
<jd***@SPAM.ME.AND.DIE.cwru.edu> wrote:
With the other (MS-SQL-Server 2000) I get an error trying to connect to the
SQL-Server:

Warning: mssql_connect(): Unable to connect to server: mySqlServerName


I might be off-base here, since the last time I tried this was in 2001,
but I remember that PHP's MS SQL support only went up to the version
just prior to MS SQL Server 2000 (6.5 or 7 maybe?). I'd be willing to
wager that that is your problem.


I think this is a limitation of the FreeTDS connection, if you're
connecting from Linux and also solved now.

HTH, Jochen

--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 16 '05 #2

P: n/a
> PHP's MS SQL support only went up to the version
just prior to MS SQL Server 2000 (6.5 or 7 maybe?).


thank you.

Running my script on another server succeed to connect to the SQL Server
2000. The difference is: on my server is an Apache on the other an IIS;
but PHP 5 is the same. So I think, this cannot be the problem.

Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.