If all the schools are the same, then only show the school name once, instead of once for each student.

This commit is contained in:
james 2007-03-29 19:36:04 +00:00
parent d209b0648f
commit e2ee104434

View File

@ -133,12 +133,21 @@
$studnum=1;
$schools="";
$students="";
$sameschools=true;
$lastschool="";
while($studentinfo=mysql_fetch_object($sq))
{
$students.="$studentinfo->firstname $studentinfo->lastname<br />";
$schools.="$studentinfo->school <br />";
if($lastschool)
{
if($lastschool!=$studentinfo->school)
$sameschools=false;
}
$lastschool=$studentinfo->school;
$stats_totalstudents++;
}
if($sameschools) $schools=$lastschool;
echo "<td>$schools</td>";
echo "<td>$students</td>";
echo "</tr>";