Basta mettere un if all'interno del while in cui controlli se la riga ti interessa o meno
codice:
$esamiPres = + query ad sql etc etc ....+
while ($rowEsamiPre = mysql_fetch_array($esamiPres))
{
  if(condizione){
  $rowEsamiPre['id_insegn']."-";
  $rowEsamiPre['data_appello']."+";
  $rowEsamiPre['tipo_appello']."-";
  $rowEsamiPre['orario']."+";
  $rowEsamiPre['nota']."
";
  }
}