Yii Framework: AJAX Call from JQuery return average from MYSQL
===

Hey everyone I'm attempting to take the value inputed in one of my forms, a country name, and query my database table for rows that have the corresponding country in the country column. I would then like to take those rows, and average together the values for a certain column, std_rate, of those rows. hen take that value and dynamically update anothe field in my form called PackagingMetric_std_rate. This is what I have so far, but I cannot get it to work. I've tried several different methods, but nothing seems to work!

This is my jquery statement...

    $('#country').bind('change',function() 
	{
	  var input_country = $('#country').val();
	  
	  $.ajax({
	  type: 'POST',
	  data: input_country,
	  url: 'country_rate.php',
	  
	  success: function(data) {
	  
	  $('#PackagingMetric_std_rate').html(data);
        }
		
	});


	});

It should be calling this file, 'country_rate.php' which is contained in the same directory as the form calling this file with Ajax.

    <?php
    $host = "localhost";
    $user = "admin";
    $password = "password"; 
    
    $database = "myDatabase";
    
    $country = $POST['input_country'];
    
    $connection = mysql_connect($host,$user,$password);
    $dbs = mysql_select_db($databaseName,$connection);
    
    $query = mysql_query("SELECT AVG(std_rate)FROM packaging_metrics WHERE country like `$country` ");
    $std_rate = mysql_fetch_row($query); 
    
    $std_rate = json_encode($std_rate); 


I am getting no change when country is changed in my form. No error, or anything. Is there something wrong with my setup? Any help would be greatly appreciated. 

