I am fetching multiple records from database and try to store into json array, but the only last record will get stored into array, can any one have any idea about this? How to store multiple data into an json array. and I have to display this array on the full-calendar.
here is my code:
foreach($result as $row){
$records[$i][0]=substr($row['date'], 0, 10);
$records[$i][1]=$row['in_time'];
$records[$i][2]=$row['out_time'];
$records[$i][3]=$row['attendance'];
$e['date']=$records[$i][0];
$e['start']=$records[$i][1];
$e['end']=$records[$i][2];
$e['attendance']=$records[$i][3];
$i++;
}
echo json_encode($e);
how to create multiple records json data ?