Here is an interesting observation.
MS driver php_pdo_sqlsrv_82_nts_x64.dll
Connection: $conn = new PDO("sqlsrv:server=$serverName;Database=$database", $uid, $pwd);
Ther is case sensitivity when accessing data using the column name.
See here that the query returns a single column of data "RefName".
Referencing $row['RefName'] (matching case) returns the cell value.
Referencing $row['refname'] (or any non matching case) returns blank.
Here is the code;
$query = "select top 5 RefName from AvailableReferences;";
$stmt = $conn->query($query);
while ( $row = $stmt->fetch() ){
echo "Cell value ".$row['RefName']."<br />\n";
}
echo "<br />";
$stmt = $conn->query($query);
while ( $row = $stmt->fetch() ){
echo "Cell value ".$row['refname']."<br />\n";
}
This code produces the following:
Matching case:
Cell value STAFFID
Cell value PRODUCTCATEGORYID
Cell value PRODUCTID
Cell value SALEID
Cell value SALETYPEID
Non matching case
Cell value
Cell value
Cell value
Cell value
Cell value
Anyone familiar with this? Is there a way to ignore case?
Thanks