0

I am trying to Create a simple webservice (written in PHP) for android which make a Db Call to SQL Server and it is deployed on IIS

<?php

$serverName = "MyDB/Instance"; 
$connectionInfo = array( "Database"=>"MyDB", "UID"=>"MYID", "PWD"=>"MyPWD");
$conn = sqlsrv_connect( $serverName, $connectionInfo);


$tsql = "SELECT * FROM tblEmployee";  

$stmt = sqlsrv_query( $conn, $tsql);  

if ( $stmt )  
{  
     echo "Statement executed.<br>\n";  
}   
else   
{  
     echo "Error in statement execution.\n";  

     die( print_r( "Error", true));  
}  

while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_NUMERIC))  
{  
     echo "Col1: ".$row[0]."\n";  
     echo "Col2: ".$row[1]."\n";  
     echo "Col3: ".$row[2]."<br>\n";  
     echo "-----------------<br>\n";  
}  

sqlsrv_free_stmt( $stmt);  
sqlsrv_close( $conn);  
?>  

................ My Browser simply not supporting this

enter image description here

My Port is working fine

enter image description here

This is My Error Log Found on C:\inetpub\logs\LogFiles\W3SVC11

#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2016-07-05 07:38:34
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2016-07-05 07:38:34 ::1 GET / - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 - 200 0 0 31402
2016-07-05 07:38:34 ::1 GET /Content/site.css - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 http://localhost:8092/ 200 0 0 1
2016-07-05 07:38:34 ::1 GET /Scripts/modernizr-2.6.2.js - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 http://localhost:8092/ 200 0 0 104
2016-07-05 07:38:34 ::1 GET /Content/bootstrap.css - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 http://localhost:8092/ 200 0 0 117
2016-07-05 07:38:34 ::1 GET /Scripts/respond.js - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 http://localhost:8092/ 200 0 0 115
2016-07-05 07:38:34 ::1 GET /Scripts/bootstrap.js - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 http://localhost:8092/ 200 0 0 116
2016-07-05 07:38:34 ::1 GET /Scripts/jquery-1.10.2.js - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 http://localhost:8092/ 200 0 0 366
2016-07-05 07:38:36 ::1 GET /favicon.ico - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 http://localhost:8092/ 200 0 0 38
2016-07-05 07:39:01 ::1 GET /select.php - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 - 500 0 0 817
2016-07-05 07:39:52 ::1 GET /select.php - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 - 500 0 0 30
#Software: Microsoft Internet Information Services 10.0
#Version: 1.0
#Date: 2016-07-05 08:22:23
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
2016-07-05 08:22:23 ::1 GET / - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 - 200 0 0 4699
2016-07-05 08:22:34 ::1 GET /select.php - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 - 500 0 0 480
2016-07-05 08:25:56 ::1 GET / - 8092 - ::1 Mozilla/5.0+(Windows+NT+10.0)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36 - 200 0 0 8

I tried to run on another browser , but it also got unresponsive

I am not able to diagnose the Error that what wrong happening inside ? I found some article to rightly connect php Page with Sql Server , and I Believe My Code is right , Still Not able to find the cause ,

Cœur
  • 37,241
  • 25
  • 195
  • 267
Neeraj Verma
  • 2,174
  • 6
  • 30
  • 51

0 Answers0