<?php

// --- Database Configuration ---
// Warning: Hardcoding credentials directly in the script is not recommended for production environments.
// Consider using environment variables or a separate configuration file.
$host = "localhost";
$dbName = "digitalb_beaccurate";
$userName = "digitalb_beaccurate";
$pass = "Saiful.1633";
$tableName = "VersionControl"; // Corrected variable name as per SQL query

$conn = new mysqli($host, $userName, $pass, $dbName);
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// --- Prepare SQL Statement ---
$sql = "SELECT `Minimum` FROM `$tableName`"; // Using $tableName for clarity and consistency
$stmt = $conn->prepare($sql);
if ($stmt === false) {
    die("Error preparing statement: " . $conn->error);
}

if ($stmt->execute()) {
    $result = $stmt->get_result(); // Get the result set
    if ($result->num_rows > 0) {
        $row = $result->fetch_assoc(); // Fetch the first row as an associative array
        echo $row['Minimum']; // Echo the 'Minimum' value
    } else {
        echo "No minimum value found."; // Handle case where no rows are returned
    }
} else {
    echo "Error executing statement: " . $stmt->error; // Handle execution error
}

// --- Close statement and connection ---
$stmt->close();
$conn->close();

?>