<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<?php
$tmima = intval($_GET['q']);
echo "xxx".$tmima;
require("dbconnect.php");
 
$sql2 = "SELECT mitroo,eponimo,onoma  FROM allstudentinfo WHERE tmima='$tmima'";
$result = mysqli_query($con,$sql2);

echo "<table border='1'>
<tr>
<th>Α.Μ.</th>
<th>Ονοματεπώνυμο</th><
</tr>";

while($row = mysqli_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['mitroo'] . "</td>";
  echo "<td>" . $row['eponimo'] ." ".$row['onoma']. "</td>";
  echo "</tr>";
  }
echo "</table>";

mysqli_close($con);
?>