Hey!!!
I am just trying to connect MS SQL Server 2008 R2 from PHP Version 5.3.16 using IIS 7.0.
I am able to connect my MS Sql Server but I am getting junk data eventhough there is a valid data exists. I don't know what is the reason for that. Below is my code snippet.
$conn = odbc_connect("Driver={SQL Server Native Client 10.0};Server=$server;Database=$db;", 'xxxxx', 'xxxxx');
$rs = odbc_exec($conn,$strSQL);
if (!$rs){
exit("Error in SQL");
}
$index = 1;
while (odbc_fetch_row ($rs)){
echo $index . "," . odbc_result($rs, 1) . "," . odbc_result($rs, 2);
$index++;
}
Below is my output when I execute the above code:
1,�user,xuY
2,�user,xuY
Can you please help me on this?
Thanks in advance,
Cheers,
-R