So I'm writing a php project and I got stuck on hyphens in column names of a table in a database. I have the following code:
$results = $conn->query($sql)->fetchAll(PDO::FETCH_OBJ);
foreach ($results as $row) { ?>
<tr>
<td><a href="#<?= $row->factuur-status ?>"><?= $row->factuur-status ?></a></td>
<td><?= $row->verkoop-orderid ?></td>
</tr>
<?php } ?>
Now obviously because of the hyphens in the column names this doesn't work. How can one fix this?