PHP provides a direct connection to the MSSQL Database command, like a MySQL connection, as I described below.
The following is the ODBC build connection code.
| The code is as follows |
Copy Code |
|
$con = Odbc_connect (' ODBC name ', ' username ', ' password '); |
2. Connecting mssql2000
| The code is as follows |
Copy Code |
|
$con = Mssql_connect (' Database address ', ' username ', ' password '); |
3. Connecting mssql2008
| The code is as follows |
Copy Code |
|
$connectionInfo = Array ("UID" + user name, "PWD" + = password, "database" + "DB name");
$con = sqlsrv_connect (database address, $connectionInfo); |
The above method is very simple I will not introduce, only tell if the connection is not successful we can do the following settings (php.ini file
Extension=php_pdo_mssql.dll; Extension=php_pdo_odbc.dll in front of the semicolon)
http://www.bkjia.com/PHPjc/630727.html www.bkjia.com true http://www.bkjia.com/PHPjc/630727.html techarticle PHP provides a direct connection to the MSSQL Database command, like a MySQL connection, as I described below. The following is the ODBC build connection code. The code below copies the code $con = oDB ...