RE: [PHP] MSSQL_CONNECT problem

From: Date: Wed, 10 Dec 2008 15:10:42 +0000
Subject: RE: [PHP] MSSQL_CONNECT problem
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.general 
Request: Send a blank email to php-general+get-284422@lists.php.net to get a copy of this message
From: Dan Shirah [mailto:mrsquash2@gmail.com] 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?

« previous php.general (#284422) next »