note 51953 rejected from ref.mssql by betz

From: Date: Sat, 16 Apr 2005 17:51:10 +0000
Subject: note 51953 rejected from ref.mssql by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-88089@lists.php.net to get a copy of this message
Note Submitter: dwilson at innovativecomputers dot net ---- Frustrated: Win2003 Server, SQL Server, PHP 5, all on the same machine. Here is my code: <? $server="localhost"; $username="username"; $password="password"; $sqlconnect=mssql_connect($server, $username, $password); $sqldb=mssql_select_db("Northwind",$sqlconnect) or DIE("DATABASE FAILED TO RESPOND."); $sqlquery="SELECT companyName FROM Customers;"; $results= mssql_query($sqlquery); while ($row=mssql_fetch_array($results)){ echo $row['companyName']."<br>\n";} mssql_close($sqlconnect); ?> Here is my error: Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'INNOVATIVE\IUSR_INNOVATIVE1'. (severity 14) in E:\Websites\RealEstate(dons)\dbtest3.php on line 5 I have tried many variations of the above code, including adding the port# (even though this should be unnecessary with everything residing on the same box), creating different user names inside of SQL Server (not only users for a particular database but for the entire server under security.) I have checked the ntwdblib.dll and made sure it was in the right place, i have checked the php.ini file till my face is blue. I do successfully connect using odbc like this: <? $dsn="RealEstateTool"; $username="username"; $password="password"; $sqlconnect=odbc_connect($dsn,$username,$password); $sqlquery="SELECT companyname FROM Customers;"; $process=odbc_exec($sqlconnect, $sqlquery); while(odbc_fetch_row($process)){ $companyName = odbc_result($process,"companyName"); echo "$companyName<br>"; } odbc_close($sqlconnect); ?> I have also set up multiple DSN's on the server. Any help would be greatly appreciated.

« previous php.notes (#88089) next »