From: Dan Shirah [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 10, 2008 9:42 AM
To: David Stoltz
Cc: Daniel Brown; Bastien Koert; php-general@lists.php.net
Subject: Re: [PHP] MSSQL_CONNECT problem
 
        Is INTRA_SQL your instance name or database name?  If it is the
instance
        name, is that instance setup to use 1433 as the port?  I know
1433 is
        the
        default port for MSSQL, but the majority of people change that.
        
        
        Correct - intra_sql is the instance, yes, it's using default
port 1433
        (which is also specified in the php.ini file)....I've tried
connecting
        with and without specifying the port - but both ways don't
work....
 
Perhaps you have a different version of PHP than me...but nowhere in the
php.ini file have I had to put in a port number for a MSSQL Server.
 
That seems like a problem since PHP could need to connect to any number
of SQL Servers with any port number.
 
>From your PHP server, open a command prompt and ping your SQL server.
Try pinging by IP address and by server name.  See if you get a response
from both.
 
NOTE: Are you running PHP and MSSQL Server on the same box?
 
 
Yes - I get a response with both IP and hostname - like I said before, I
can connect to the SQL server (which IS a different box) from PHP but
only if I use ADO. Once I try and connect using mssql_connect, it
fails....
 
I guess I can continue to use ADO - but the whole idea was to use
mssql_bind so I can use parameterized queries. Currently, my ADO queries
are vulnerable to SQL Injection....
 
So yes - my WEB/PHP box can "see" the SQL server if I use ADO.
 
Perhaps I should try to install the SQL 2005 PHP driver - even though
I'm using SQL 2000....maybe that will help? 
 
 
 

Reply via email to