I have this code in php that printed the result array of select mysql:
It currently prints the name, date and end time and start of the event.
How would I add an item in the array, such as the "id" of each record?
header('Content-Type: application/json');
$start = mysqli_real_escape_string($connection,$_GET["start"]);
$end = mysqli_real_escape_string($connection,$_GET["end"]);
$result = mysqli_query($connection,"SELECT 'id', 'start' ,'end' ,'title','ativo' FROM 'events' where (date(start) >= '$start' AND date(start) <= '$end' AND ativo='nao' ) ");
while($row = mysqli_fetch_assoc($result))
{
$events[] = $row;
}
echo json_encode($events);
exit;