<?php session_start(); 

$_SESSION['county']; 

$county=$_SESSION['county']; 



$con=mysql_connect("localhost","datascri_health","changeforhealth123$%^") or die("Error connecting to mysql!!!!");

 

mysql_select_db("datascri_changeforhealth", $con); 



$sth = mysql_query("SELECT * FROM development_budget where county='".$county."'");

$rows = array();

$flag = true;



$table = array();



$table['cols'] = array(

    array('label' => 'county', 'type' => 'string'),

	array('label' => '2010_11', 'type' => 'number'),

	array('label' => '2011_12', 'type' => 'number'),

	array('label' => '2012_13', 'type' => 'number'),

	array('label' => '2013_14', 'type' => 'number'),

    //array('label' => 'SEMANA_5', 'type' => 'number')

);



$rows = array();

while($r = mysql_fetch_assoc($sth)) {

    $temp = array();

	$temp[] = array('v' => (string) $r['county']); 

	$temp[] = array('v' => (int) $r['2010_11']); 

	$temp[] = array('v' => (int) $r['2011_12']); 

	$temp[] = array('v' => (int) $r['2012_13']); 

	$temp[] = array('v' => (int) $r['2013_14']); 

	//$temp[] = array('v' => (int) $r['S5']); 

    $rows[] = array('c' => $temp);

}



$table['rows'] = $rows;



$jsonTable = json_encode($table);



echo $jsonTable;



?>