Install the sqlsrv module of php
//Local connection
$serverName = "CX95DLISVW4C6TKaaa";//Computer name instance name
$connectionInfo = array("Database"=>"fff","ConnectionPooling"=>'' ,'UID'=>'sa','PWD'=>'123');
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn == false)
{
echo "Connect Failed! ";
die( print_r( sqlsrv_errors(), true));
}else{
echo "dfdf";
$query=sqlsrv_query($conn,"select * from dbo.fdsf");
while($ row = sqlsrv_fetch_array($query)){
print_r($row);
}
//print_r($query);
}
//Remote connection
$serverName = "192.168.1.5";
$connectionInfo = array ("Database"=>"CIA","ConnectionPooling"=>'','UID'=>'sa','PWD'=>'360kad.com');
$conn = sqlsrv_connect( $ serverName, $connectionInfo);
if( $conn == false)
{
echo "Connection failed!";
die( print_r( sqlsrv_errors(), true));
}else{
echo "dfdf";
$ query=sqlsrv_query($conn,"select * from CodeSiteTaker_Model");
while($row = sqlsrv_fetch_array($query)){
print_r($row);
}
//print_r($query);
}