i want to use Cal-Heatmap to visualize data and my current sql result is returned as
[ { "dateStampSecs": "1499637600", "value": "1" } ]
but i want
[ { "1499637600" : 1 } ]
How do I stick them together?
I am using Codeigniter and below is my sql:
public function get_calData(){
$this->db->select('unix_timestamp(STR_TO_DATE(date_start, "%Y-%m-%d")) dateStampSecs,count(*) as value');
$this->db->from('calendar');
$query = $this->db->get()->result();
print json_encode($query,JSON_PRETTY_PRINT);
}
