$result = mysql_query("SELECT * FROM profiles WHERE class = 'bard'",$db);
if ($myrow = mysql_fetch_row($result)) {
echo "<img src=bards.jpg>\n";
echo "<table align=center>\n";
do {
printf("<tr><th width=200><font size=2><a href=\"acroproster.php?id=%s\">%s</th><th width=15><font size=2>%s</th><th width=20><font size=2> +%s</th>\n",
$myrow[0], $myrow[1], $myrow[3], $myrow[6]);
<lots of code in here that isnt really important for here>
} while ($myrow = mysql_fetch_row($result));
echo "</table><br><br>\n";
}
that is how i have it now. after this is identical code except the class name to put the next class on the page. What i want to do is instead of doing this code over and over for each class, I want to have a line or two that will make it do this code again but use the next class until there are no more classes. The db looks similar to this
id name password lvl class race
1 john g36fh56dg 23 bard human
2 joe 43j5hgkj45 45 bard human
3 chris 43kj5hg34 43 cleric human
as you can see some rows have the same class so it would need to know to only do each class once.