Hi, i want to display values from a database (a list of categories) into a table that has 2 columns and x number of rows.
I want my web page to display like this:
Apes Cats Apples Cherries Bats Tigers Berries Zebras
Instead of
Apes Apples Bats Bears Cats Cherries Tigers Zebras
Here is my code so far:
<table border="0" bordercolor="#FFCC00" style="background-color:#FFFFCC" width="400" cellpadding="3" cellspacing="3">
<?php
$query = "SELECT * FROM category ORDER BY cat_name";
$data = mysqli_query($dbc, $query);
while ($category = mysqli_fetch_array($data)) {
?>
<tr>
<td><?php echo $category['cat_name'] ?></td>
</tr>
<?php } ?>
</table>