<?php
	header('Content-type: application/json');

	include('database.php');
	DB_connexion(); 
	
	$playerID = 10;
	
	$sql = "SELECT * FROM evolution WHERE playerid = '$playerID' ";
	$result = mysql_query($sql);

	$rows = array();
	while($r = mysql_fetch_array($result))
	{
		
		$row[0] = $r["date"];
		$row[1] = $r["rating"];
		array_push($rows,$row);
	}

	print json_encode($rows, JSON_NUMERIC_CHECK);
	
/*	
	xAxis: {
        type: 'datetime',
        tickPixelInterval: 100, 
        maxZoom:  60 
    },
*/

/*
dataArray = ("2.4","5.6","3.1", ...);
timeArray = ("1366585199","1366585233","1366585355", ...)

       function foo(dataArray, timeArray) {
            $('#viz_1').highcharts({
                chart: {
                    type: 'line'
                },
                title: {
                    text: 'Data Index'
                },
                xAxis: {
                    type: 'datetime', // this isn't doing anything??
                    categories: timeArray
                },
                yAxis: {
                    title: {
                    text: 'Data Value'
                    },
                },
                series: [{
                    name: topicID,
                    data: JSON.parse("[" + dataArray + "]")
                }]
            })
        }; 
*/

?>

