<?php
include("/var/www/2a685b61-ba1a-4056-abd9-0883231735ff/public_html/monzaclube/config.php");
$conecta = new mysqli(BD_HOST,BD_USUARIO,BD_SENHA,BD_BANCO);

$i = 1;
$sql = $conecta->query("SELECT * FROM eventos ORDER BY data DESC");
while ($consulta = $sql->fetch_assoc()){
$evNum = 'evento_'.$i;
$event[$evNum]['id'] = $consulta['id'];
$event[$evNum]['descricao'] = $consulta['descricao'].' - '.date("d/m/Y", strtotime($consulta['data']));
$i = $i + 1;}

$json_string = json_encode($event);

echo $json_string;
?>