hi, am newbie in php,am trying to populate a html table from a database;each row must contain only 4 cells filled with the categories name. Bellow is the code that i have created but it shows repeated categories names in each row, can somebody help me plz!
<?php
/**
* use case 1:Select a Category
* @author elvis
* @copyright 2012
*/
require_once ('system/config/config.php');
$connect = mysql_connect(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD) or die ("check your server connection.");
mysql_select_db(DB_DATABASE);
$quey1="select * from category";
$result=mysql_query($quey1) or die(mysql_error());
?>
<div align="center">
<table border="1" width="600">
<caption><EM>Select a Category</EM></caption>
<?php
while($row=mysql_fetch_array($result)){ ?>
<tr>
<?php $catid=$row['category_id'];?>
<td align='center'>
<img src="<?php echo $row['category_image']; ?>" /><br />
<a href="http://localhost/GoDeli/model/bo/select.php?catid=<?php echo $catid ?>"><?php echo $row['category_name']; ?></a>
</td>
<td align='center'>
<img src="<?php echo $row['category_image']; ?>" /><br />
<a href="http://localhost/GoDeli/model/bo/select.php?catid=<?php echo $catid ?>"><?php echo $row['category_name']; ?></a>
</td>
</tr>
<?php } ?>
</table>
</div>

