<?php
$sql2 = mysqli_query($con,"SELECT DISTINCT tmima FROM allstudentinfo ORDER BY tmima "); 
?>

<form  method='post'> 
<h4> ΕΠΙΛΟΓΗ  ΤΜΗΜΑΤΟΣ</h4>
<label>Τμήμα:</label>
<select name='tmimaid' id='tmimaid' >
<?php
	echo "<option value='---'>select</option>";
    while($row2 = mysqli_fetch_array($sql2) ) 
	{
          echo "<option value='$row2[tmima]'>$row2[tmima]</option>";
    }
?>
</select>
<input type="submit" name="submit1" value="Επιβεβαίωση Επιλογής" >
</form>
<?php