<?php
// Create connection if not already set
if (!isset($con)) {
    $con = mysqli_connect("localhost", "apexunio_nexusb", "Casper2017$$$", "apexunio_nexusb");

    if (!$con) {
        die("Failed to connect to MySQL: " . mysqli_connect_error());
    }
}

// Fetch settings (assuming one row)
$query = "SELECT sitname, semail, stelp, lcha FROM settings LIMIT 1";
$result = mysqli_query($con, $query);

if ($result) {
    $settings = mysqli_fetch_assoc($result);
} else {
    die("Query failed: " . mysqli_error($con));
}
// Make sure this is at the top of your file!
$query = mysqli_query($con, "SELECT * FROM settings LIMIT 1");
$settings = mysqli_fetch_assoc($query);

?>