<?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 galeria ORDER BY id ASC");
while ($consulta = $sql->fetch_assoc()){
$evNum = 'galeria_'.$i;
$galeria[$evNum]['id'] = $consulta['id'];
$galeria[$evNum]['tipo'] = $consulta['tipo'];
$galeria[$evNum]['descricao'] = $consulta['descricao'];
$galeria[$evNum]['recurso'] = $consulta['recurso'];
$galeria[$evNum]['altText'] = $consulta['altText'];
$galeria[$evNum]['status'] = $consulta['status'];
$i = $i + 1;}

$json_string = json_encode($galeria);

echo $json_string;
?>