<?php
//Include database configuration file
include('../Server/connection.php');

if(!empty($_POST["vBrandId"])){
	
	
    //Get all state data
    $query = $conn->query("SELECT * FROM vehicle_models WHERE vehicle_brand_id = ".$_POST['vBrandId']." ORDER BY vehicle_model_name");
    
    //Count total number of rows
    $rowCount = $query->num_rows;
    
    //Display states list
    if($rowCount > 0){
        //echo '<option value="">Chagua Kata</option>';
        while($row = $query->fetch_assoc()){ 
            echo '<option value="'.$row['vehicle_model_id'].'">'.$row['vehicle_model_name'].'</option>';
        }
    }else{
        echo '<option value="">No Vehicle Model </option>';
    }
	

			
}


?>