help with html table code, displaying values from database

amotmepeaboni

New Member
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 CatsApples CherriesBats TigersBerries ZebrasInstead ofApes ApplesBats BearsCats CherriesTigers ZebrasHere is my code so far:\[code\] <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 = http://stackoverflow.com/questions/3752624/mysqli_query($dbc, $query); while ($category = mysqli_fetch_array($data)) { ?> <tr> <td><?php echo $category['cat_name'] ?></td> </tr> <?php } ?> </table>\[/code\]
 
Back
Top