<?php 
// Include the database config file 
include_once 'connection.php'; 

 
if(!empty($_POST["class_id"])){ 
    // Fetch state data based on the specific country 
    $query = "SELECT * FROM subject WHERE class_id = ".$_POST['class_id']." AND status = 1 ORDER BY program ASC"; 
    $result = $conn->query($query); 
     
    // Generate HTML of state options list 
    if($result->num_rows > 0){ 
        echo '<option value="">Select Program</option>'; 
        while($row = $result->fetch_assoc()){  
            echo '<option value="'.$row['code'].'">'.$row['code'].' | '.$row['program'].'</option>'; 
        } 
    }else{ 
        echo '<option value="">Program not available</option>'; 
    } 
} 
?>
<script src="stp_con/jquery/jquery.min.js"></script>