Good morning.
I have a table that lists CLASSES and the class size limits - and a separate table that lists SIGNUPS for those particular classes. I am trying to output the following content:
CLASS - #BEG - #BEG2 - #INT - # INT2 - etc etc
Class1 - 4 - 1 - 6 - 3
Class2 - 1 - 3 - 5 - 2
What I am getting is a repeat of the counts from the first class. IE
CLASS - #BEG - #BEG2 - #INT - # INT2 - etc etc
Class1 - 4 - 1 - 6 - 3
Class2 - 4 - 1 - 6 - 3
I know I am missing something small...anyone have an idea? Here is the snippet:
$class_count = mysql_query("SELECT * FROM php_classes WHERE old='0'");
if ($myrow = mysql_fetch_array($class_count)) {
do {
$result_total = mysql_query("SELECT * FROM php_signup WHERE class_id='".$myrow['id']."' AND queue='1'");
$total = mysql_numrows($result_total);
$result_count = mysql_query("SELECT class,class_id, COUNT(class_id) AS count FROM php_signup WHERE class_id='".$myrow['id']."' AND queue='1' GROUP BY class") or exit(mysql_error());
while ($row = mysql_fetch_assoc($result_count))
{ echo $row['class'] . ' - ' . $row['count'] . ' result(s) ' . $row['raid_id'] . ' <br>';
if ($row['class'] == 'Beginner') {$c1 = $row['count'];} if ($c1 < 1) {$c1 = 0;}
if ($row['class'] == 'BeginnerII') {$c2 = $row['count'];} if ($c2 < 1) {$c2 = 0;}
if ($row['class'] == 'Intermed') {$c3 = $row['count'];} if ($c3 < 1) {$c3 = 0;}
if ($row['class'] == 'IntermedII') {$c4 = $row['count'];} if ($c4 < 1) {$c4 = 0;}
if ($row['class'] == 'Advanced') {$c5 = $row['count'];} if ($c5 < 1) {$c5 = 0;}
if ($row['class'] == 'AdvancedII') {$c6 = $row['count'];} if ($c6 < 1) {$c6 = 0;}
if ($row['class'] == 'Special') {$c7 = $row['count'];} if ($c7 < 1) {$c7 = 0;}
if ($row['class'] == 'Custom') {$c8 = $row['count'];} if ($c8 < 1) {$c8 = 0;}
}
$start_date = date("m/d/Y", $myrow["start_time"]);
$start_time = date("h:i A", $myrow["start_time"]);
$desc = str_replace("\n","<br>",$data['description']);
$desc = str_replace("'","\'",$desc);
$desc = str_replace("\r","",$desc);
if(strlen($desc) > 50)
$desc = substr($desc, 0, 50) . '...';
printf("<tr>
<td class='color2' nowrap>%s </td>
<td class='color2' nowrap>%s </td>
<td class='color2' nowrap>%s </td>
<td class='color2' nowrap>%s </td>
<td class='color2' nowrap>%s/%s </td>
<td class='color2' nowrap>%s/%s </td>
<td class='color2' nowrap>%s/%s </td>
<td class='color2' nowrap>%s/%s </td>
<td class='color2' nowrap>%s/%s </td>
<td class='color2' nowrap>%s/%s </td>
<td class='color2' nowrap>%s/%s </td>
<td class='color2' nowrap>%s/%s </td>
<td class='color2' nowrap>%s/%s </td></tr>\n",
$start_date,
$myrow["id"],
$desc,
$start_time,
$c1,
$myrow['c1_lmt'],
$c2,
$myrow['c2_lmt'],
$c3,
$myrow['c3_lmt'],
$c4,
$myrow['c4_lmt'],
$c5,
$myrow['c5_lmt'],
$c6,
$myrow['c6_lmt'],
$c7,
$myrow['c7_lmt'],
$c8,
$myrow['c8_lmt'],
$total,
$myrow["max"]);
}
while ($myrow = mysql_fetch_array($class_count));
}