Query: mssql_connect
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
MSSQL_CONNECT(3) MSSQL_CONNECT(3) mssql_connect - Open MS SQL server connectionSYNOPSISresource mssql_connect ([string $servername], [string $username], [string $password], [bool $new_link = false])DESCRIPTIONmssql_connect(3) establishes a connection to a MS SQL server. The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling mssql_close(3).PARAMETERSo $servername - The MS SQL server. It can also include a port number, e.g. hostname:port (Linux), or hostname,port (Windows). o $username - The username. o $password - The password. o $new_link - If a second call is made to mssql_connect(3) with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned. This parameter modifies this behavior and makes mssql_connect(3) always open a new link, even if mssql_connect(3) was called before with the same parameters.RETURN VALUESReturns a MS SQL link identifier on success, or FALSE on error.CHANGELOG+--------+------------------------------------+ |Version | | | | | | | Description | | | | +--------+------------------------------------+ | 5.1.0 | | | | | | | The $new_link parameter was added | | | | +--------+------------------------------------+EXAMPLESExample #1 mssql_connect(3) example <?php // Server in the this format: <computer><instance name> or // <server>,<port> when using a non default port number $server = 'KALLESPCSQLEXPRESS'; // Connect to MSSQL $link = mssql_connect($server, 'sa', 'phpfi'); if (!$link) { die('Something went wrong while connecting to MSSQL'); } ?>SEE ALSOmssql_close(3), mssql_pconnect(3). PHP Documentation Group MSSQL_CONNECT(3)