PHPcode $ host192.168.1.122; -- IP $ port1433; -- Port $ instanset02; -- instance name $ usernamesa; $ passwordpassss; if (! $ Linkmssql_connect ($ host. php connection to the instance name in the SQLSERVER connection string
PHP code
$ Host = '2017. 168.1.122 '; -- IP $ port = 1433; -- port $ instanse = 't02'; -- instance name $ username = 'sa'; $ password = 'passs'; if (! $ Link = mssql_connect ($ host. ':'. $ port. $ instanse, $ username, $ password) -- It seems wrong
122 of SQLSERVER has multiple instances. I do not want to connect to the default instance, but want to connect to the T02 instance
In SSMS, the format is 192.168.1.122, 1433 \ t02.
Where is the instance name of SQLSERVER written? The writing method above is not acceptable
------ Solution --------------------
// Server in the this format: \ Or
// , When using a non default port number
$ Server = 'kallespc \ SQLEXPRESS ';
// Connect to MSSQL
$ Link = mssql_connect ($ server, 'sa ', 'phpfi ');
If (! $ Link ){
Die ('something wrong while connecting to mssql ');
}
?>