<?php

header('Content-Type: application/json');


/*
$servername = "localhost";
$username = "wes";
$password = "12345";
$dbname = "triggers";
*/

$servername = "localhost";
$username = "u950110925_triggers";
$password = "[o2VJeI2";
$dbname = "u950110925_triggers";

$response = ['success' => false, 'data' => [], 'error' => ''];

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
  $response['error'] = "Connection failed: " . $conn->connect_error;
  echo json_encode($response);
  exit();
}

$sql = "SELECT `id`, `misses` FROM miss";

$result = $conn->query($sql);
$misses = [];

while ($row = $result->fetch_assoc()) {
    $misses[] = $row;
}
echo json_encode($misses);
$conn->close();
?>
