here is the code I have so far but its not working...
<?
$db = mysql_connect("localhost", "jimbo", "passhide");
mysql_select_db("4th");
$query = "select cat_name, eq_name from cats, equip where equip.cat_id = cats.cat_id order by cat_name, eq_name";
$result = mysql_query($query);
$num_rows = mysql_numrows($result);
$rows = mysql_fetch_array($result);
$lastcat = '';
$i = 0;
while ($i < $num_rows)
{
if ($lastcat != ($rows["cat_id"]))
{
echo ($rows["cat_name"]);
}
$lastcat = ($rows["cat_id"]);
++$i;
}
?>