I have a query where I'm already pulling back the results from a Sql query via an array as below.
<?php
$sql = "SELECT inc.STATUS as STATUS,
FROM dbo.HELP_DESK as inc";
$result = sqlsrv_query($conn, $sql);
$status=(
'1' => "Request For Authorization",
'3' => "Pending",
'4' => "Scheduled For Review",
'5' => "Scheduled For Approval",
'8' => "Pending",
);
echo "<table><tr id=\"header\"><td><center>Status</center></td><tr>";
while($row = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC)) {
echo "<tr><td><b><center> " . $row["STATUS"] . "</center></b></td></tr>";
}
echo "</table>";
sqlsrv_close( $conn );
?>
The $row fetches back a number from the database. However, I'm wanting to display the text from my $status array.
I've tried several methods but end up with a blank screen returned.
Any suggestions? Appreciate the help.