<?php
$result_scrapt=$dbh->prepare("select * from scrap where item='total' and item3='$row_kingslanding->schoolclass' and type='reportdown'");
$result_scrapt->execute();
$row_scrapt=$result_scrapt->fetchObject();
$count_scrapt=$result_scrapt->rowCount();

$result_scrapam=$dbh->prepare("select * from scrap where item='averagemark' and item3='$row_kingslanding->schoolclass' and type='reportdown'");
$result_scrapam->execute();
$row_scrapam=$result_scrapam->fetchObject();
$count_scrapam=$result_scrapam->rowCount();

$result_scrappc=$dbh->prepare("select * from scrap where item='positionclass' and item3='$row_kingslanding->schoolclass' and type='reportdown'");
$result_scrappc->execute();
$row_scrappc=$result_scrappc->fetchObject();
$count_scrappc=$result_scrappc->rowCount();

$result_scrapps=$dbh->prepare("select * from scrap where item='positionstream' and item3='$row_kingslanding->schoolclass' and type='reportdown'");
$result_scrapps->execute();
$row_scrapps=$result_scrapps->fetchObject();
$count_scrapps=$result_scrapps->rowCount();

$result_examset=$dbh->query("select * from examsets where autoid='' $exam1 $exam2 $exam3 $exam4 $exam5 $exam6 $exam7 $exam8 $exam9 $exam10 $exam11 $exam12 $exam13 $exam14 $exam15 $exam16 $exam17 $exam18 $exam19 $exam20");
$row_examset=$result_examset->fetchObject();
$count_examset=$result_examset->rowCount();
?>