<?php
function getDatabaseConnection($bdname) {
    $servername = "directoriofitness.com.mx";
    $username = "direct18";
    $password = "L4LL4v3M@3str@";

   $conn = new mysqli($servername, $username, $password, $bdname);
    if ($conn->connect_error) {
        http_response_code(500);
        echo json_encode(["error" => "Error de conexión: " . $conn->connect_error]);
        exit;
    }
    $conn->set_charset("utf8");
    return $conn;
}
?>