
<?php
include('dbconnect.php');
//collect the passed id
$idx=$_GET['kath']+1;
$result = mysqli_query($con,"SELECT * FROM timetable where id='$idx'");
$row = mysqli_fetch_assoc($result);
$subj=array_slice($row, 3);
	$i=1;
	foreach ($subj as $s)
	{
		$ar=explode('/',$s);
		$sbj[$i]=$ar[1];
		$i++;
	}
	$subject=array_unique($sbj);


//loop through all returned rows
foreach ($subject as $sub){ 
          echo "<option value='$sub'>$sub</option>";
      }


