Telenet Cloud Online Help

How does the connection between PHP and MSSQL work?

A native php mssql driver nl. sqlsrv_connect ipv mssql_connect is used

You will find more information on the following link:

Example of a connection:

/* Specify the server and connection string attributes. */
$serverName = "(";

/* Get UID and PWD from application-specific files. */
$connectionInfo = array( "UID"=>”test”,

/* Connect using SQL Server Authentication. */
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
echo "Unable to connect.</br>";
die( print_r( sqlsrv_errors(), true));

sqlsrv_close( $conn);

Additional information:
Working with Microsoft SQL Server driver (php_sqlsrv.dll) for PHP on Windows

mssql vs. sqlsrv: What’s the Difference? (Part 1)

SQLSRV Driver API Reference
0 (0)
Article Rating (No Votes)
Rate this article
There are no attachments for this article.
Related Articles
Is Zend Guard/Optimizer supported?
Viewed 1329 times since Mon, Jul 23, 2012
Is ionCube Encoder/Loader supported?
Viewed 1919 times since Thu, Jul 19, 2012
How do I track problems in my PHP website?
Viewed 2298 times since Fri, Jan 21, 2011
What is PHP?
Viewed 2331 times since Thu, Nov 27, 2008
How do I hide any PHP errors on my website?
Viewed 1074 times since Tue, Jul 24, 2012
Where can I find the PHP manual?
Viewed 1619 times since Tue, Nov 18, 2008
How do I send mail from my website using PHP?
Viewed 12445 times since Mon, Nov 9, 2009
Are PDO and SQLite supported on the shared hosting?
Viewed 2237 times since Tue, Jul 24, 2012
How do I recognize PHP pages/scripts?
Viewed 2676 times since Tue, Nov 18, 2008
Which PHP version is installed on the server? Which modules are available?
Viewed 2813 times since Tue, Nov 18, 2008