I have categories (duplicate listings) that I need to get to single occurances (that’s done), then have each one tied a number starting at 1, stopping at whatever the highest number is in that set. Everything I’ve tried so far doesn’t get the numbers to change. For example, my attempt below outputs just a 1 for every category. Obviously I’m doing something wrong or have the code in the wrong place, but don’t know how I should set it up. Please, help!
[CODE] $catmenu = mysql_query(“SELECT subcategory, category FROM $DBTABLE1 ORDER BY category, subcategory”);
$expcatmenu = mysql_query(“SELECT DISTINCT category FROM $DBTABLE1 ORDER BY category”);
$enumrows=mysql_num_rows($expcatmenu);
for($e = 1; $e <= $enumrows; $e++)
while($row = mysql_fetch_array($catmenu))
{
$CAT=$row[‘category’];
$SUBCAT=$row[‘subcategory’];
if ($CAT != $prev_row)
{
echo “<br><font face=”Arial, Helvetica, sans-serif” size=2><b><a onClick=”expandcontent(‘$e’)”><u>$e $CAT</u></a></b></font><br><div id=”$e” class=”switchcontent”>”;
}
$encCAT=htmlentities($CAT);
$encSUBCAT=htmlentities($SUBCAT);
echo “ <font face=”Arial, Helvetica, sans-serif” size=2><a href=”http://www.navi-gator.com/demo/bg-testing/sfm/products.php?cat=$encCAT&subcat=$encSUBCAT”>$SUBCAT</div></a></font>”;
$prev_row=$CAT;
}