1<?php
2$servername = "localhost";
3$username = "username";
4$password = "password";
5$dbname = "myDB";
6
7// Create connection
8$conn= mysqli_connect($servername,$username,$password,$dbname);
9// Check connection
10if (!$conn) {
11 die("Connection failed: " . mysqli_connect_error());
12}
13echo "Connected Successfully.";
14?>
1$serverName = "serverName\sqlexpress"; //serverName\instanceName
2$connectionInfo = array( "Database"=>"dbName", "UID"=>"userName", "PWD"=>"password");
3$conn = sqlsrv_connect( $serverName, $connectionInfo);
4