I have a table which has a category, then an item.
I want to create a webpage that lists them as follows :
category 1
item 1
item 2
item 3
category 2
item 1
item 2
category 3
item 1
item 2
item 3
but at the moment, my code is producing :
category 1 item 1
category 1 item 2
category 1 item 3
category 2 item 1
category 2 item 2
category 3 item 1
etc etc
i am using :
printf("<tr><td width=\"200\" valign=top><strong><font size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\"><a href=%s>%s</a></font></strong></td><td width=\"50\" valign=top><strong><font size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\"> </font></strong></td><td width=\"450\" valign=top><font size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">%s </font></td></tr>\n", $myrow["link"],$myrow["proper"], $myrow["item"]);
} while ($myrow = mysql_fetch_array($result));
echo "</table>\n";
} else {
sorry if thats confusing. Link and proper are just displaying the category with a hyperlink.
Any help appreciated!
Helen