<?php
echo "<table style='width:500px' class='myTable' >
<tr style='border:1px solid black' bgcolor='#FFAF80'  >
<th>ΣΤΟΙΧΕΙΑ ΜΑΘΗΤΗ/ΜΑΘΗΤΡΙΑΣ</th>
<th>ΤΜΗΜΑ</th>
<th>ΒΟΗΘΟΣ ΔΙΕΥΘ.</th>
<th>ΥΠΕΥΘΥΝΟΣ ΚΑΘ.</th>
</tr>";

$sql = mysqli_query($con,"SELECT * FROM allstudentinfo WHERE mitroo='$mitr'  " );
$row = mysqli_fetch_array($sql);
$stname=$row['eponimo']." ".$row['onoma'];
$tmimaid=$row['tmima'];
 echo "<tr>";
 echo "<td>".$stname. "</td>";
 echo "<td>".$tmimaid. "</td>";
 $sql = mysqli_query($con,"SELECT v.voi_id,t.Name,v.yt FROM voithos as v,teachers as t WHERE v.Class_id='$tmimaid' AND v.voi_id=t.PMP  " );
 $row = mysqli_fetch_array($sql);
 $vdname=$row['Name'];
 $yt=$row['yt'];
 echo "<td>".$vdname. "</td>";
 $sql = mysqli_query($con,"SELECT Name FROM teachers WHERE PMP='$yt' " );
 $row = mysqli_fetch_array($sql);
 $ytname=$row['Name'];
 echo "<td>".$ytname. "</td>";
 echo "</tr>";
 echo "</table>";
 echo "<br>";