<?php
$servername = "br386.hostgator.com.br";
$username = "onabet10_will";
$password = "102030Bacon!";
$dbname = "onabet10_brejonetwork";

// Crie a conexão
$conn = new mysqli($servername, $username, $password, $dbname);

// Verifique a conexão
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT data_coleta, origem FROM dados_whatsapp"; // Ajuste a consulta conforme necessário
$result = $conn->query($sql);

$data = array();
while($row = $result->fetch_assoc()) {
  $data[] = $row;
}

$conn->close();

header('Content-Type: application/json');
echo json_encode($data);
?>
