Hoe verloopt de connectie tussen PHP en MSSQL?

Er wordt gebruik gemaakt van een native php mssql driver nl. sqlsrv_connect ipv mssql_connect

Op volgende link vindt u meer informatie: http://msdn.microsoft.com/en-us/library/cc296189(SQL.90).aspx

Voorbeeld van een connectie:

<?php
/* Specify the server and connection string attributes. */
$serverName = "(sql27.hostbasket.com)";

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

/* 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);
?>

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

http://blogs.iis.net/donraman/archive/2010/01/25/working-with-microsoft-sql-server-driver-php-sqlsrv-dll-for-php-on-windows.aspx

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

http://blogs.msdn.com/b/brian_swan/archive/2010/03/08/mssql-vs-sqlsrv-what-s-the-difference-part-1.aspx

SQLSRV Driver API Reference

http://msdn.microsoft.com/en-us/library/cc296152(SQL.90).aspx
 
Posted : - Mon, Jul 23, 2012 4:28 PM. This article has been viewed 1787 times.
Online URL: https://onlinehelp.cloud.telenet.be/article.php?id=2564

Powered by PHPKB (Knowledge Base Software)