I'm struggeling with this one. How can list all devices, their model and supplier from my database? The data is stored comma-separated in the fields device, model and supplier.
<?php
while ($row = mysqli_fetch_array($result)) {
$device_explode = explode(',', $row['device']);
$model_explode = explode(',', $row['model']);
$supplier_explode = explode(',', $row['supplier']);
$device = array(array($device_explode[0]), //count function? How would I do that?
array($model_explode[0]),
array($supplier_explode[0])
);
echo "<table border='1'>
<tr>
<th>Møterom</th>
<th>Romnummer</th>
<th>Lokasjon</th>
<th>Antall sitteplasser</th>
<th>Tilgjengelig utstyr</th>
<th>Bilde av rommet</th>
<th>Endre</th>
<th>Slett</th>
</tr>
<tr>
<td>".$row['name']."</td>
<td>".$row['roomnbr']."</td>
<td>".$row['location']."</td>
<td>".$row['seats']."</td>
<td>".$device[0][0]."<br>".$device[1][0]."<br>".$device[2][0]."<br></td> //also count?
<td><img src='../img/uploads/".$row['img']."' width='150px' ></td>
<td><a href='?p=editconfroomv2&id=".$row['id']."'>Endre</a></td>
<td><a href='./index.php?p=deleteconfroomdb&id=".$row['id']."' class='delete'>Slett</a></td>
</tr>
</table>";
}
?>