<?php
header('Content-type: text/json');
require "/home/desenvwor/public_html/videos/config/config.php";
$conecta = new mysqli(BD_HOST,BD_USUARIO,BD_SENHA,BD_BANCO);

$i = 1;
$sql = $conecta->query("SELECT * FROM banner ORDER BY id ASC");
while ($consulta = $sql->fetch_assoc()){
$evNum = 'banner_'.$i;
$banner[$evNum]['id'] = $consulta['id'];
$banner[$evNum]['descricao'] = $consulta['descricao'];
$banner[$evNum]['arquivo'] = $consulta['arquivo'];
$banner[$evNum]['status'] = $consulta['status'];
$i = $i + 1;}

$json_string = json_encode($banner);

echo $json_string;
?>