Php connection to local area network mssql [cause: it is not associated with a trusted SQLServer connection] code PHPcode $ hostname & quot; HTSC & quot; $ dbuser & quot; sa & quot ;; $ dbpasswd & quot; 123456 & quot; $ idmssql_connect ($ hostname, $ db php connection to Lan mssql [cause: not associated with trusted SQL Server connection]
Code
$ Hostname = "HTSC"; $ dbuser = "sa"; $ dbpasswd = "123456"; $ id = mssql_connect ($ hostname, $ dbuser, $ dbpasswd) or die ("unable to connect to the database server! ");
If it is a local mssql database, the link passes. However, it won't work if another machine in the Lan is connected. Error message:
Warning: mssql_connect () [function. mssql-connect]: message: User '(null)' login failed. Cause: it is not associated with a trusted SQL Server connection. (Severity 14)
I tried a lot of methods and I couldn't do it:
1. hybrid mode for SQL Server and Windows
2. in addition to sa, you have also tried to add other users (with all permissions) for the link.
3. telnet ip 1433 passed the test
4. databases are all sql2000 sp4
5. I have tried changing some computers.
6. use ntwdblib. dll of sql2000 to overwrite the php5 file
In addition, the code I wrote in vb can normally access another mssql server.
Check that there is an aspnet user in mssql. do you want to add a php user similar to this to log on?
Please help
------ Solution --------------------
Change $ hostname to an IP address.
------ Solution --------------------
Is the main author using PHP to connect to SQL SERVER?
If you need to configure php. ini, remove the ones before extension = php_mssql.dll.
By default, no extended library is loaded.
------ Solution --------------------
------ Solution --------------------
------ Solution --------------------
It seems that I have encountered this problem before.
Can you directly use sqlserver's graphic interface to access other computers through the local machine?
------ Solution --------------------
Is it a Firewall problem?
------ Solution --------------------
Try again.