<?php
session_start();

?>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
table.myTable { border-collapse:collapse; }
table.myTable td, table.myTable th { border:1px solid black;padding:2px;font-size:11px; }
<p style="font-size:11px;"></p>
</style>


</head>
<body  style="width:995px; margin:0 auto; ">

<?php 
require("dbconnect.php");

$sql=  mysqli_query($con,"SELECT  dilosimath.* FROM dilosimath,allstudentinfo  WHERE allstudentinfo.mitroo=dilosimath.mitroo  ");


while ($row=mysqli_fetch_array($sql))
{
  $mitroo=$row['mitroo'];
  $mth[1]=$row['math1'];
  $mth[2]=$row['math2'];
  $mth[3]=$row['math3'];
  $mth[4]=$row['math4'];
  for ($i=1;$i<=4;$i++)
  {
	  if ($mth[$i] <> NULL ) {
		  $sql1= "INSERT INTO mathall (mitroo,mathima) VALUES ('$mitroo', '$mth[$i]' )" ;   
	      if (!mysqli_query($con,$sql1)){die('Error: ' . mysqli_error($con));}}
  } 

}
?>	
<br /><br />
<a  href='indexd.php' style="color:blue "  > <button> Επιστροφή στο Μενού  </a>

</body>
</html>