
<?php

session_start();

include('dbconnect.php');

//collect the passed id

$id = $_GET['arsimperiforas'];
echo $id;

//run a query

$sql = mysqli_query($con,"SELECT areidostimorias FROM paraptoma_timoria WHERE arsimperiforas='$id'");

//loop through all returned rows

while($row = mysqli_fetch_array($sql) ) {
    $m=$row['eidostimorias'];
	$sql1 = mysqli_query($con,"SELECT perigrafi FROM eidostimorias WHERE areidostimorias='$m'");
	$row1 = mysqli_fetch_array($sql1);
	$k=$row1['perigrafi'];
	$dispitem=$k;
	echo "<option value='$k'>$dispitem</option>";

}
?>