<?php
$servidor = "localhost";
$usuario = "kaltekgo_painel";
$senha = "painel@2024";
$dbname = "kaltekgo_painel";

$conn = mysqli_connect($servidor, $usuario, $senha, $dbname);
if (!$conn) {
    echo json_encode(['erro' => 'Conexão falhou']);
    exit;
}

$sql = "SELECT * FROM senhasPainelFundamental WHERE status = 'ativo'  ORDER BY id DESC, nomeProfessor ASCLIMIT 1";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);

echo json_encode($row);
