I'm trying to retrieve values from a database and encode them as JSON for another script to grab. I'm doing this like this:

for($i=0; $i<7; $i++)
				$nextDay = $i+1;
			  	$startDateTime = date("Y-m-d H:i:s", strtotime("-$i days"));
		  		$endDateTime = date("Y-m-d H:i:s", strtotime("-$nextDay days"));
		  		$query = "select count(*) as cnt from app_instances where (time between '$endDateTime' and '$startDateTime') and (app_id = '$appId')  group by title";
		  		$result = $database->prepare($query);
				$row = $result->fetch();
				$count = (int)$row['cnt'];
					$count = 0;
				$thisVal = array();
				$thisVal[]= $count;


			$thisContent = json_encode($dataArray);

This gives the result:


But what I really need is something like:

[[1, 30], [2, 152], [3, 45], [4, 34], [5, 56], [6,67], [7, 56]]

But if I try to add the key to the array manually, it returns as objects.
Can anyone help?

just note that json_encode() returns the data in


this fashion if the array passed to it is -


otherwise have a look at this customized thing