In your response.php, around the while loop part, this should work -
$dataArr['aaData'] = Array();
while($row = $res->fetch_assoc()){
$r = Array();
foreach($row as $key=>$value){
$r[] = "$key $value";
}
$dataArr['aaData'][] = $r;
}
header('Content-Type: application/json');
echo json_encode($dataArr);
/*
The output will be of the form,
{
"aaData": [
[
[
"colname data"
...
],
]
*/