the problem in storing option value from echo part into PHP variable
$var=$_POST[select_tag_name]
$query="SELECT subject.`SubjectName` 
        FROM `subject` 
            LEFT JOIN `class-sub-info` USING(SubjectId) 
        WHERE `ClassID`=$classid";
    $result=mysqli_query($con,$query);
    if(mysqli_num_rows($result) > 0) 
    {
        while($row=mysqli_fetch_assoc($result))
        {
            echo "<option value=".$row["SubjectId"].">".$row["SubjectName"]."</option>";
        }   
    }
expecting an easy way to store that value into a php variable
 
     
    