0

Have a hard time trying to echo the $status arrays value into the cell where the $row['status'] is. Right now it prints the DB values of 0-3. if it is a "0" print uploaded.....

    while ($row = mysqli_fetch_assoc($result)) {
$status = array('uploaded', 'processing', 'error', 'closed');
?>
<tr align="center">
<td><?php echo $row['case_id']; ?></td>
<td><?php echo $row['doctor']; ?></td>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['upload_date']; ?></td>
<td><?php echo $row['service_date']; ?></td>
<td><?php echo $row['status']; ?></td>
<td><?php echo $row['message']; ?></td>
</tr>
<?php
};
Steveep
  • 25
  • 6

1 Answers1

0

Just echo $status using $row['status'] as the key:

<td><?php echo $status[$row['status']]; ?></td>
AbraCadaver
  • 78,200
  • 7
  • 66
  • 87