rendered paste body<?
$rsCat = mysql_query("select c.catid, c.name, ( select count(v.id) from vendors v where v.catid = c.catid ) as num_vendors order by c.name asc")
or die(mysql_error());
?>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<th>Category ID</th>
<th>Category Name</th>
<th>Num Vendors</th>
</tr>
<? while ( $row = mysql_fetch_array($rsCat, MYSQL_ASSOC) ) { ?>
<tr>
<td><?= $row["catid"]?></td>
<td><?= $row["name"]?></td>
<td><?= $row["num_vendors"]?></td>
</tr>
<? } ?>
</table>